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

Commit 744e7e1c authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Test to null-check NotificationEntryManager.performRemoveNotification()

Bug: 123327642
Test: atest NotificationEntryManagerTest

Change-Id: Ia1e971e6e786798821809a1e801d462f3c189e83
parent 76b50d37
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -521,6 +521,16 @@ public class NotificationEntryManagerTest extends SysuiTestCase {
        verify(extender2).setShouldManageLifetime(mEntry, false);
    }

    /**
     * Ensure that calling NotificationEntryManager.performRemoveNotification() doesn't crash when
     * given a notification that has already been removed from NotificationData.
     */
    @Test
    public void testPerformRemoveNotification_removedEntry() {
        mEntryManager.getNotificationData().remove(mSbn.getKey(), null /* ranking */);
        mEntryManager.performRemoveNotification(mSbn);
    }

    private Notification.Action createAction() {
        return new Notification.Action.Builder(
                Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),