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

- first round: move tests that currently pass

Bug: 62103184
Test: make SettingsUnitTests
Change-Id: Ief3adf88e5090621e5ec3957a71d1b56b4be186a
This commit is contained in:
Doris Ling
2017-08-09 15:52:26 -07:00
parent b5a5cc251a
commit 109bb5e59a
15 changed files with 25 additions and 27 deletions

View File

@@ -14,6 +14,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
mockito-target-minus-junit4 \
truth-prebuilt \
ub-uiautomator \
espresso-intents-nodep \
# Include all test java files.

View File

@@ -27,6 +27,7 @@ import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -30,6 +30,7 @@ import android.provider.Settings;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,25 +1,22 @@
package com.android.settings;
import android.content.Intent;
import android.content.Context;
import static com.google.common.truth.Truth.assertThat;
import android.app.Instrumentation;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceGroupAdapter;
import com.android.settings.accessibility.AccessibilitySettings;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceGroupAdapter;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static com.google.common.truth.Truth.assertThat;
import com.android.settings.accessibility.AccessibilitySettings;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@SmallTest

View File

@@ -17,24 +17,26 @@
package com.android.settings.search;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.hasFocus;
import static android.support.test.espresso.matcher.ViewMatchers.withClassName;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.AllOf.allOf;
import android.support.test.filters.SmallTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.widget.SearchView;
import com.android.settings.R;
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.matcher.ViewMatchers.hasFocus;
import static android.support.test.espresso.matcher.ViewMatchers.withClassName;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.AllOf.allOf;
import com.android.settings.R;
@RunWith(AndroidJUnit4.class)
@SmallTest

View File

@@ -20,8 +20,6 @@ import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import com.android.settings.Settings;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -24,8 +24,6 @@ import android.support.test.uiautomator.UiSelector;
import android.support.test.uiautomator.UiScrollable;
import android.test.InstrumentationTestCase;
import com.android.settings.R;
import org.junit.Test;
@SmallTest