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 {
92
92
assertThat(sharedSessionRepository.isInForeground).isFalse()
93
93
94
94
// This will not update background time since the process is already in the background
95
+ val originalBackgroundTime = fakeTimeProvider.currentTime()
95
96
CrashEventReceiver .notifyCrashOccurred()
96
97
assertThat(sharedSessionRepository.localSessionData.backgroundTime)
97
- .isEqualTo(fakeTimeProvider.currentTime() )
98
+ .isEqualTo(originalBackgroundTime )
98
99
99
100
// Wait a bit, then bring the process to foreground
100
101
fakeTimeProvider.addInterval(31 .minutes)
@@ -107,13 +108,13 @@ class CrashEventReceiverTest {
107
108
108
109
// Wait a bit, then notify of a crash
109
110
fakeTimeProvider.addInterval(3 .seconds)
111
+ val newBackgroundTime = fakeTimeProvider.currentTime()
110
112
CrashEventReceiver .notifyCrashOccurred()
111
113
112
114
runCurrent()
113
115
114
116
// Verify the background time got updated
115
- assertThat(sharedSessionRepository.localSessionData.backgroundTime)
116
- .isEqualTo(fakeTimeProvider.currentTime())
117
+ assertThat(sharedSessionRepository.localSessionData.backgroundTime).isEqualTo(newBackgroundTime)
117
118
118
119
// Clean up
119
120
fakeDataStore.close()
You can’t perform that action at this time.
0 commit comments