Use external/robolectric-shadows/run_robotests.mk

This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
This commit is contained in:
James Lemieux
2018-02-26 00:51:42 -08:00
parent 229a6a2bc4
commit 22a39c2b93
752 changed files with 5096 additions and 9182 deletions

View File

@@ -36,7 +36,6 @@ import android.support.v7.preference.PreferenceScreen;
import android.util.ArraySet;
import android.view.View;
import com.android.settings.TestConfig;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
@@ -59,11 +58,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
shadows = {
ShadowEntityHeaderController.class,
ShadowRestrictedLockUtils.class
})
@Config(shadows = {ShadowEntityHeaderController.class, ShadowRestrictedLockUtils.class})
public class AppDataUsageTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
@@ -92,9 +87,8 @@ public class AppDataUsageTest {
mFragment = spy(new AppDataUsage());
doReturn(mock(PreferenceManager.class, RETURNS_DEEP_STUBS))
.when(mFragment)
.getPreferenceManager();
when(mFragment.getPreferenceManager())
.thenReturn(mock(PreferenceManager.class, RETURNS_DEEP_STUBS));
doReturn(mock(PreferenceScreen.class)).when(mFragment).getPreferenceScreen();
ReflectionHelpers.setField(mFragment, "mAppItem", mock(AppItem.class));
@@ -125,9 +119,8 @@ public class AppDataUsageTest {
when(mHeaderController.setUid(fakeUserId)).thenReturn(mHeaderController);
when(mHeaderController.setHasAppInfoLink(anyBoolean())).thenReturn(mHeaderController);
doReturn(mock(PreferenceManager.class, RETURNS_DEEP_STUBS))
.when(mFragment)
.getPreferenceManager();
when(mFragment.getPreferenceManager())
.thenReturn(mock(PreferenceManager.class, RETURNS_DEEP_STUBS));
doReturn(mock(PreferenceScreen.class)).when(mFragment).getPreferenceScreen();
mFragment.onViewCreated(new View(RuntimeEnvironment.application), new Bundle());