Move the Robolectric shadow config up.

In my testing, this reduces the runtime of the Robolectric Settings test
suite on my Z840 workstation from 440 seconds to 402 seconds on average.
By avoiding having a method-level Robolectric shadow import, we avoid
going down a code path which needs to add more shadows later in the
Robolectric execution.

Bug: 64808827
Test: Settings robotests still pass
Change-Id: I7b40d73b30306ae3f9759281afbd7f7266579e24
This commit is contained in:
Daniel Nishi
2017-08-17 14:34:05 -07:00
parent 682ff5562c
commit 739b0eef10
15 changed files with 74 additions and 67 deletions

View File

@@ -83,7 +83,11 @@ import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(
manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION,
shadows = InstalledAppDetailsTest.ShadowUtils.class
)
public final class InstalledAppDetailsTest {
private static final String PACKAGE_NAME = "test_package_name";
@@ -491,7 +495,6 @@ public final class InstalledAppDetailsTest {
}
@Test
@Config(shadows = ShadowUtils.class)
public void handleDisableable_appIsEnabled_buttonShouldWork() {
final ApplicationInfo info = new ApplicationInfo();
info.packageName = "pkg";
@@ -513,7 +516,6 @@ public final class InstalledAppDetailsTest {
}
@Test
@Config(shadows = ShadowUtils.class)
public void handleDisableable_appIsEnabledAndInKeepEnabledWhitelist_buttonShouldNotWork() {
final ApplicationInfo info = new ApplicationInfo();
info.packageName = "pkg";