Make Settings robotest work with tot Robolectric

Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
This commit is contained in:
Fan Zhang
2018-10-11 15:37:36 -07:00
parent dd3feeb155
commit cdf284b732
140 changed files with 706 additions and 823 deletions

View File

@@ -82,7 +82,7 @@ public class DoubleTapPowerPreferenceControllerTest {
@Test
public void testIsChecked_configIsNotSet_shouldReturnTrue() {
// Set the setting to be enabled.
Settings.System.putInt(mContentResolver, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, ON);
Settings.Secure.putInt(mContentResolver, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, ON);
mController = new DoubleTapPowerPreferenceController(mContext, KEY_DOUBLE_TAP_POWER);
assertThat(mController.isChecked()).isTrue();
@@ -91,7 +91,7 @@ public class DoubleTapPowerPreferenceControllerTest {
@Test
public void testIsChecked_configIsSet_shouldReturnFalse() {
// Set the setting to be disabled.
Settings.System.putInt(mContentResolver, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, OFF);
Settings.Secure.putInt(mContentResolver, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, OFF);
mController = new DoubleTapPowerPreferenceController(mContext, KEY_DOUBLE_TAP_POWER);
assertThat(mController.isChecked()).isFalse();