summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2017-02-06 13:32:47 -0800
committer Selim Cinek <cinek@google.com> 2017-02-06 13:38:02 -0800
commit3f146d0de2cda30cc85bed797b289512bb8dfcef (patch)
tree74e69ad6e49aa4d28ed9ba78140750214d8be613
parent9363c695428a1a1ec80539412763b76eaf6b4b58 (diff)
Fixed test failures for notification comparator
Test: runtest systemui-notification Change-Id: I16e6142c99553d541d09390142cd16bbdfa724d2
-rw-r--r--services/tests/notification/src/com/android/server/notification/NotificationComparatorTest.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/tests/notification/src/com/android/server/notification/NotificationComparatorTest.java b/services/tests/notification/src/com/android/server/notification/NotificationComparatorTest.java
index aa08b41d69c0..064ab0a3adc4 100644
--- a/services/tests/notification/src/com/android/server/notification/NotificationComparatorTest.java
+++ b/services/tests/notification/src/com/android/server/notification/NotificationComparatorTest.java
@@ -112,6 +112,7 @@ public class NotificationComparatorTest {
Notification n2 = new Notification.Builder(mContext)
.setCategory(Notification.CATEGORY_CALL)
.setFlag(Notification.FLAG_FOREGROUND_SERVICE, true)
+ .setColorized(true /* colorized */)
.build();
mRecordHighCall = new NotificationRecord(mContext, new StatusBarNotification(callPkg,
callPkg, 1, "highcall", callUid, callUid, n2,
@@ -186,10 +187,10 @@ public class NotificationComparatorTest {
final List<NotificationRecord> expected = new ArrayList<>();
expected.add(mRecordHighCall);
expected.add(mRecordDefaultMedia);
- expected.add(mRecordStarredContact);
- expected.add(mRecordContact);
expected.add(mRecordInlineReply);
expected.add(mRecordSms);
+ expected.add(mRecordStarredContact);
+ expected.add(mRecordContact);
expected.add(mRecordEmail);
expected.add(mRecordUrgent);
expected.add(mRecordCheater);
@@ -207,14 +208,19 @@ public class NotificationComparatorTest {
@Test
public void testMessaging() throws Exception {
NotificationComparator comp = new NotificationComparator(mContext);
- assertTrue(comp.isImportantMessaging(mRecordStarredContact));
- assertTrue(comp.isImportantMessaging(mRecordContact));
assertTrue(comp.isImportantMessaging(mRecordInlineReply));
assertTrue(comp.isImportantMessaging(mRecordSms));
assertFalse(comp.isImportantMessaging(mRecordEmail));
assertFalse(comp.isImportantMessaging(mRecordCheater));
}
+ @Test
+ public void testPeople() throws Exception {
+ NotificationComparator comp = new NotificationComparator(mContext);
+ assertTrue(comp.isImportantPeople(mRecordStarredContact));
+ assertTrue(comp.isImportantPeople(mRecordContact));
+ }
+
private NotificationChannel getDefaultChannel() {
return new NotificationChannel(NotificationChannel.DEFAULT_CHANNEL_ID, "name",
NotificationManager.IMPORTANCE_LOW);