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

Commit 6787109a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Improve delete-intent-from-cached-summary tests" into main

parents 6e0fa65c 37d2cc11
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -20565,9 +20565,11 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
    @Test
    @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING)
    public void clearAll_fromUser_willSendDeleteIntentForCachedSummaries() throws Exception {
    public void clearAll_fromUser_sendsDeleteIntentForCachedSummaries() throws Exception {
        PendingIntent deleteIntent = mock(PendingIntent.class);
        NotificationRecord n = generateNotificationRecord(
                mTestNotificationChannel, 1, "group", true);
        n.getNotification().deleteIntent = deleteIntent;
        mBinderService.enqueueNotificationWithTag(mPkg, mPkg, "tag",
                n.getSbn().getId(), n.getSbn().getNotification(), n.getSbn().getUserId());
        waitForIdle();
@@ -20576,14 +20578,16 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mService.mNotificationDelegate.onClearAll(mUid, Binder.getCallingPid(), n.getUserId());
        waitForIdle();
        verify(mGroupHelper).onNotificationRemoved(eq(n), any(), eq(true));
        verify(deleteIntent).send();
    }
    @Test
    @EnableFlags(FLAG_NOTIFICATION_FORCE_GROUPING)
    public void cancel_fromApp_willNotSendDeleteIntentForCachedSummaries() throws Exception {
    public void cancel_fromApp_doesNotSendDeleteIntentForCachedSummaries() throws Exception {
        PendingIntent deleteIntent = mock(PendingIntent.class);
        NotificationRecord n = generateNotificationRecord(
                mTestNotificationChannel, 1, "group", true);
        n.getNotification().deleteIntent = deleteIntent;
        mBinderService.enqueueNotificationWithTag(mPkg, mPkg, "tag",
                n.getSbn().getId(), n.getSbn().getNotification(), n.getSbn().getUserId());
        waitForIdle();
@@ -20592,7 +20596,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mBinderService.cancelAllNotifications(mPkg, mUserId);
        waitForIdle();
        verify(mGroupHelper).onNotificationRemoved(eq(n), any(), eq(false));
        verify(deleteIntent, never()).send();
    }
    @Test