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

Commit 12712a83 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "Fix broken tests" into qt-dev am: 1115d61c

am: 4ca871a8

Change-Id: Id1599af2007f7127b65ac6d1ddb4f6bd62899976
parents 6e148d33 4ca871a8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public class AllowSoundPreferenceControllerTest {
    }

    @Test
    public void testUpdateState_notConfigurable() {
    public void testUpdateState_notBlockable() {
        String lockedId = "locked";
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.lockedChannelId = lockedId;
@@ -150,7 +150,7 @@ public class AllowSoundPreferenceControllerTest {
        Preference pref = new RestrictedSwitchPreference(mContext);
        mController.updateState(pref);

        assertFalse(pref.isEnabled());
        assertTrue(pref.isEnabled());
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public class BadgePreferenceControllerTest {
    }

    @Test
    public void testUpdateState_channelNotConfigurable() {
    public void testUpdateState_channelNotBlockable() {
        String lockedId = "locked";
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.lockedChannelId = lockedId;
@@ -198,7 +198,7 @@ public class BadgePreferenceControllerTest {
        Preference pref = new RestrictedSwitchPreference(mContext);
        mController.updateState(pref);

        assertFalse(pref.isEnabled());
        assertTrue(pref.isEnabled());
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ public class BubblePreferenceControllerTest {
    }

    @Test
    public void testUpdateState_channelNotConfigurable() {
    public void testUpdateState_channelNotBlockable() {
        String lockedId = "locked";
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.lockedChannelId = lockedId;
@@ -213,7 +213,7 @@ public class BubblePreferenceControllerTest {
        Preference pref = new RestrictedSwitchPreference(mContext);
        mController.updateState(pref);

        assertFalse(pref.isEnabled());
        assertTrue(pref.isEnabled());
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ public class DndPreferenceControllerTest {
    }

    @Test
    public void testUpdateState_notConfigurable() {
    public void testUpdateState_notBlockable() {
        String lockedId = "locked";
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.lockedChannelId = lockedId;
@@ -121,7 +121,7 @@ public class DndPreferenceControllerTest {
        Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application);
        mController.updateState(pref);

        assertFalse(pref.isEnabled());
        assertTrue(pref.isEnabled());
    }

    @Test
+1 −14
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ public class LightsPreferenceControllerTest {
    }

    @Test
    public void testUpdateState_notConfigurable() {
    public void testUpdateState_notBlockable() {
        String lockedId = "locked";
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        appRow.lockedChannelId = lockedId;
@@ -169,19 +169,6 @@ public class LightsPreferenceControllerTest {
        Preference pref = new RestrictedSwitchPreference(mContext);
        mController.updateState(pref);

        assertFalse(pref.isEnabled());
    }

    @Test
    public void testUpdateState_configurable() {
        NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
        NotificationChannel channel = mock(NotificationChannel.class);
        when(channel.getId()).thenReturn("something");
        mController.onResume(appRow, channel, null, null);

        Preference pref = new RestrictedSwitchPreference(mContext);
        mController.updateState(pref);

        assertTrue(pref.isEnabled());
    }

Loading