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:
@@ -43,7 +43,11 @@ import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
@Config(
|
||||
manifest = TestConfig.MANIFEST_PATH,
|
||||
sdk = TestConfig.SDK_VERSION,
|
||||
shadows = ShadowSecureSettings.class
|
||||
)
|
||||
public class AssistGestureSettingsPreferenceControllerTest {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
@@ -86,7 +90,6 @@ public class AssistGestureSettingsPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = ShadowSecureSettings.class)
|
||||
public void testSetValue_updatesCorrectly() {
|
||||
int newValue = 1;
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
@@ -99,7 +102,6 @@ public class AssistGestureSettingsPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = ShadowSecureSettings.class)
|
||||
public void testGetValue_correctValueReturned() {
|
||||
int currentValue = 1;
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
|
Reference in New Issue
Block a user