Move tests from tests/app/ to tests/unit/

- second round, move all remaining items
- removed SoundSettingsIntegrationTest and DashboardAdapterTest as they
are obsolete.

Fixes: 62103184
Test: make SettingsUnitTests
Change-Id: Idc2eeb285acd209ef2d00c5451fff697002e1734
This commit is contained in:
Doris Ling
2017-08-28 16:05:39 -07:00
parent 0617d139e0
commit d47606ab6d
113 changed files with 74 additions and 250 deletions

View File

@@ -0,0 +1,40 @@
package com.android.settings.deviceinfo;
import android.support.test.espresso.intent.rule.IntentsTestRule;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnitRunner;
import com.android.settings.R;
import com.android.settings.Settings.StorageDashboardActivity;
import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.intent.Intents.intended;
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtra;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@SmallTest
public class StorageDashboardFragmentTest {
public static final String EXTRA_KEY = ":settings:show_fragment";
@Rule
public IntentsTestRule<StorageDashboardActivity> mActivityRule =
new IntentsTestRule<>(StorageDashboardActivity.class, true, true);
@Test
public void testStorageManagePreference_canClickTextView() throws InterruptedException {
// Click on the actual textbox instead of just somewhere in the preference
onView(withText(R.string.automatic_storage_manager_preference_title)).perform(click());
// Check that it worked by seeing if we switched screens
intended(hasExtra(equalTo(EXTRA_KEY),
containsString(AutomaticStorageManagerSettings.class.getName())));
}
}