You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/NotificationReceivedEvent.kt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,15 @@ internal class NotificationReceivedEvent(
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/NotificationWillDisplayEvent.kt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,15 @@ internal class NotificationWillDisplayEvent(
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/generation/impl/NotificationGenerationProcessor.kt
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,9 @@ internal class NotificationGenerationProcessor(
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/generation/NotificationGenerationProcessorTests.kt
+96Lines changed: 96 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ import io.mockk.just
23
23
importio.mockk.mockk
24
24
importio.mockk.runs
25
25
importkotlinx.coroutines.delay
26
+
importkotlinx.coroutines.withTimeout
26
27
importorg.json.JSONObject
27
28
importorg.robolectric.annotation.Config
28
29
@@ -373,4 +374,99 @@ class NotificationGenerationProcessorTests : FunSpec({
373
374
)
374
375
}
375
376
}
377
+
378
+
test("processNotificationData should immediately drop the notification when will display callback indicates to") {
379
+
// Given
380
+
val context = ApplicationProvider.getApplicationContext<Context>()
381
+
val mockTime = MockHelper.time(1111)
382
+
val mockApplicationService = AndroidMockHelper.applicationService()
383
+
every { mockApplicationService.isInForeground } returns true
384
+
val mockNotificationDisplayer = mockk<INotificationDisplayer>()
385
+
val mockNotificationRepository = mockk<INotificationRepository>()
0 commit comments