Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a330abba authored by Joel Galenson's avatar Joel Galenson
Browse files

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
parent 09f76a02
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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);
    }