Add notification sent count to app info

Test: robotests
Bug: 79607096
Change-Id: I6f96ad7890ff8f224749db10fc8a18d4626cac11
This commit is contained in:
Julia Reynolds
2018-06-12 10:32:46 -04:00
parent 8ebfb12cac
commit 7b5ef08b81
5 changed files with 47 additions and 31 deletions

View File

@@ -139,10 +139,12 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 30;
appRow.channelCount = 60;
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentWeekly = 4;
assertThat(mController.getNotificationSummary(
appRow, mContext).toString().contains("30")).isTrue();
assertThat(mController.getNotificationSummary(
appRow, mContext).toString().contains("On")).isTrue();
assertThat(mController.getNotificationSummary(appRow, mContext).toString().contains(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false))).isTrue();
}
@Test
@@ -151,7 +153,10 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 0;
appRow.channelCount = 10;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo("On");
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentDaily = 4;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false));
}
@Test
@@ -160,6 +165,9 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 0;
appRow.channelCount = 0;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo("On");
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentDaily = 7;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false));
}
}