Fix broken tests
Test: robo tests Fixes: 130871450 Change-Id: If7b01147f5680392c7635f3a3b4e558aa56a633e
This commit is contained in:
@@ -139,7 +139,7 @@ public class AllowSoundPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_notConfigurable() {
|
public void testUpdateState_notBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -150,7 +150,7 @@ public class AllowSoundPreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(mContext);
|
Preference pref = new RestrictedSwitchPreference(mContext);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -187,7 +187,7 @@ public class BadgePreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_channelNotConfigurable() {
|
public void testUpdateState_channelNotBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -198,7 +198,7 @@ public class BadgePreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(mContext);
|
Preference pref = new RestrictedSwitchPreference(mContext);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -202,7 +202,7 @@ public class BubblePreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_channelNotConfigurable() {
|
public void testUpdateState_channelNotBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -213,7 +213,7 @@ public class BubblePreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(mContext);
|
Preference pref = new RestrictedSwitchPreference(mContext);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -110,7 +110,7 @@ public class DndPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_notConfigurable() {
|
public void testUpdateState_notBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -121,7 +121,7 @@ public class DndPreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application);
|
Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -158,7 +158,7 @@ public class LightsPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_notConfigurable() {
|
public void testUpdateState_notBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -169,19 +169,6 @@ public class LightsPreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(mContext);
|
Preference pref = new RestrictedSwitchPreference(mContext);
|
||||||
mController.updateState(pref);
|
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());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -209,6 +209,7 @@ public class NotificationPreferenceControllerTest {
|
|||||||
appRow.lockedChannelId = sameId;
|
appRow.lockedChannelId = sameId;
|
||||||
NotificationChannel channel = mock(NotificationChannel.class);
|
NotificationChannel channel = mock(NotificationChannel.class);
|
||||||
when(channel.getId()).thenReturn(sameId);
|
when(channel.getId()).thenReturn(sameId);
|
||||||
|
when(channel.getImportance()).thenReturn(IMPORTANCE_LOW);
|
||||||
|
|
||||||
mController.onResume(appRow, channel, null, null);
|
mController.onResume(appRow, channel, null, null);
|
||||||
assertFalse(mController.isChannelBlockable());
|
assertFalse(mController.isChannelBlockable());
|
||||||
@@ -223,8 +224,10 @@ public class NotificationPreferenceControllerTest {
|
|||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = "something";
|
appRow.lockedChannelId = "something";
|
||||||
appRow.lockedImportance = true;
|
appRow.lockedImportance = true;
|
||||||
|
NotificationChannel channel = mock(NotificationChannel.class);
|
||||||
|
when(channel.getImportance()).thenReturn(IMPORTANCE_LOW);
|
||||||
|
|
||||||
mController.onResume(appRow, mock(NotificationChannel.class), null, null);
|
mController.onResume(appRow, channel, null, null);
|
||||||
assertFalse(mController.isChannelBlockable());
|
assertFalse(mController.isChannelBlockable());
|
||||||
|
|
||||||
appRow.lockedImportance = false;
|
appRow.lockedImportance = false;
|
||||||
|
@@ -161,7 +161,7 @@ public class SoundPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_notConfigurable() {
|
public void testUpdateState_notBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -173,7 +173,7 @@ public class SoundPreferenceControllerTest {
|
|||||||
Preference pref = new NotificationSoundPreference(mContext, attributeSet);
|
Preference pref = new NotificationSoundPreference(mContext, attributeSet);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -140,7 +140,7 @@ public class VibrationPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateState_notConfigurable() {
|
public void testUpdateState_notBlockable() {
|
||||||
String lockedId = "locked";
|
String lockedId = "locked";
|
||||||
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
|
||||||
appRow.lockedChannelId = lockedId;
|
appRow.lockedChannelId = lockedId;
|
||||||
@@ -151,7 +151,7 @@ public class VibrationPreferenceControllerTest {
|
|||||||
Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application);
|
Preference pref = new RestrictedSwitchPreference(RuntimeEnvironment.application);
|
||||||
mController.updateState(pref);
|
mController.updateState(pref);
|
||||||
|
|
||||||
assertFalse(pref.isEnabled());
|
assertTrue(pref.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user