Make Settings robotest work with tot Robolectric
Bug: 116278591 Test: make -j RunSettingsRoboTests Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
This commit is contained in:
@@ -100,7 +100,7 @@ public class SwipeToNotificationPreferenceControllerTest {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||
// Set the setting to be enabled.
|
||||
final Context context = RuntimeEnvironment.application;
|
||||
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 1);
|
||||
Settings.Secure.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 1);
|
||||
mController = new SwipeToNotificationPreferenceController(context, KEY_SWIPE_DOWN);
|
||||
|
||||
assertThat(mController.isChecked()).isTrue();
|
||||
@@ -112,7 +112,7 @@ public class SwipeToNotificationPreferenceControllerTest {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||
// Set the setting to be disabled.
|
||||
final Context context = RuntimeEnvironment.application;
|
||||
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 0);
|
||||
Settings.Secure.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 0);
|
||||
mController = new SwipeToNotificationPreferenceController(context, KEY_SWIPE_DOWN);
|
||||
|
||||
assertThat(mController.isChecked()).isFalse();
|
||||
|
||||
Reference in New Issue
Block a user