Cover orphan notification cleanup through language refresh
This commit is contained in:
1 parent
d67991d08a
commit
edc6b32fa7
1 file changed
+5
-2
+5
-2
@@ -196,10 +196,13 @@ class IncomingCallLifecycleTest {
|
||||
PendingIntent.created.forEach { assertEquals(1, it.cancelCalls) }
|
||||
}
|
||||
|
||||
@Test fun languageRefreshWithoutCallOnlyCreatesChannel() {
|
||||
IncomingCallManager.refreshLanguage()
|
||||
@Test fun languageRefreshWithoutCallPreparesChannelAndClearsOrphanedNotification() {
|
||||
notifications.active[IncomingCallManager.NOTIF_ID] = Notification()
|
||||
repeat(3) { IncomingCallManager.refreshLanguage() }
|
||||
assertEquals(1, notifications.channels.size)
|
||||
assertTrue(notifications.posted.isEmpty())
|
||||
assertTrue(notifications.active.isEmpty())
|
||||
assertEquals(listOf(IncomingCallManager.NOTIF_ID), notifications.cancellations)
|
||||
assertTrue(power.locks.isEmpty())
|
||||
assertTrue(RingtoneManager.created.isEmpty())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user