From a330abba0a8c1f39267cc88da2215ca8a150bde7 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Thu, 7 Feb 2019 19:36:21 -0800 Subject: [PATCH] Fix broken tests. This test was passing in invalid values for the namespace and key. Modify it to use the correct ones. Change-Id: Idc6971c20d64b711953bdde9fe710f592b04e807 Fixes: 124077137 Test: atest VibrateWhenRingPreferenceControllerTest --- .../VibrateWhenRingPreferenceControllerTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java index 3f53ce923cd..a1b65c5e74c 100644 --- a/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/VibrateWhenRingPreferenceControllerTest.java @@ -81,7 +81,7 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void display_shouldDisplay() { when(mTelephonyManager.isVoiceCapable()).thenReturn(true); - DeviceConfig.setProperty("namespace", "key", "false", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "false", false); mController.displayPreference(mScreen); assertThat(mPreference.isVisible()).isTrue(); } @@ -89,7 +89,7 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void display_shouldNotDisplay_notVoiceCapable() { when(mTelephonyManager.isVoiceCapable()).thenReturn(false); - DeviceConfig.setProperty("namespace", "key", "false", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "false", false); mController.displayPreference(mScreen); assertThat(mPreference.isVisible()).isFalse(); } @@ -97,7 +97,7 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void display_shouldNotDisplay_RampingRingerEnabled() { when(mTelephonyManager.isVoiceCapable()).thenReturn(true); - DeviceConfig.setProperty("namespace", "key", "true", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "true", false); mController.displayPreference(mScreen); assertThat(mPreference.isVisible()).isFalse(); } @@ -105,7 +105,7 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void display_shouldNotDisplay_VoiceEnabled_RampingRingerEnabled() { when(mTelephonyManager.isVoiceCapable()).thenReturn(true); - DeviceConfig.setProperty("namespace", "key", "true", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "true", false); mController.displayPreference(mScreen); assertThat(mPreference.isVisible()).isFalse(); } @@ -113,7 +113,7 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void display_shouldNotDisplay_VoiceDisabled_RampingRingerEnabled() { when(mTelephonyManager.isVoiceCapable()).thenReturn(false); - DeviceConfig.setProperty("namespace", "key", "true", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "true", false); mController.displayPreference(mScreen); assertThat(mPreference.isVisible()).isFalse(); } @@ -139,14 +139,14 @@ public class VibrateWhenRingPreferenceControllerTest { @Test public void voiceCapable_availabled() { when(mTelephonyManager.isVoiceCapable()).thenReturn(true); - DeviceConfig.setProperty("namespace", "key", "false", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "false", false); assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); } @Test public void voiceCapable_notAvailabled() { when(mTelephonyManager.isVoiceCapable()).thenReturn(false); - DeviceConfig.setProperty("namespace", "key", "false", false); + DeviceConfig.setProperty("telephony", "ramping_ringer_enabled", "false", false); assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); }