File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
firebase-sessions/src/test/kotlin/com/google/firebase/sessions/api Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,10 @@ class CrashEventReceiverTest {
9292 assertThat(sharedSessionRepository.isInForeground).isFalse()
9393
9494 // This will not update background time since the process is already in the background
95+ val originalBackgroundTime = fakeTimeProvider.currentTime()
9596 CrashEventReceiver .notifyCrashOccurred()
9697 assertThat(sharedSessionRepository.localSessionData.backgroundTime)
97- .isEqualTo(fakeTimeProvider.currentTime() )
98+ .isEqualTo(originalBackgroundTime )
9899
99100 // Wait a bit, then bring the process to foreground
100101 fakeTimeProvider.addInterval(31 .minutes)
@@ -107,13 +108,13 @@ class CrashEventReceiverTest {
107108
108109 // Wait a bit, then notify of a crash
109110 fakeTimeProvider.addInterval(3 .seconds)
111+ val newBackgroundTime = fakeTimeProvider.currentTime()
110112 CrashEventReceiver .notifyCrashOccurred()
111113
112114 runCurrent()
113115
114116 // Verify the background time got updated
115- assertThat(sharedSessionRepository.localSessionData.backgroundTime)
116- .isEqualTo(fakeTimeProvider.currentTime())
117+ assertThat(sharedSessionRepository.localSessionData.backgroundTime).isEqualTo(newBackgroundTime)
117118
118119 // Clean up
119120 fakeDataStore.close()
You can’t perform that action at this time.
0 commit comments