@@ -239,35 +239,12 @@ public void testDelayedAppStart() {
239
239
}
240
240
241
241
@ Test
242
- public void testStartFromBackground () {
243
- FakeScheduledExecutorService fakeExecutorService = new FakeScheduledExecutorService ();
244
- AppStartTrace trace =
245
- new AppStartTrace (transportManager , clock , configResolver , fakeExecutorService );
246
- trace .setIsStartFromBackground ();
247
- trace .onActivityCreated (activity1 , bundle );
248
- Assert .assertNull (trace .getOnCreateTime ());
249
- ++currentTime ;
250
- trace .onActivityStarted (activity1 );
251
- Assert .assertNull (trace .getOnStartTime ());
252
- ++currentTime ;
253
- trace .onActivityResumed (activity1 );
254
- Assert .assertNull (trace .getOnResumeTime ());
255
- fakeExecutorService .runAll ();
256
- // There should be no trace sent.
257
- verify (transportManager , times (0 ))
258
- .log (
259
- traceArgumentCaptor .capture (),
260
- ArgumentMatchers .nullable (ApplicationProcessState .class ));
261
- }
262
-
263
- @ Test
264
- public void testStartFromBackground_invertedOrder () {
242
+ public void testStartFromBackground_within100ms () {
265
243
FakeScheduledExecutorService fakeExecutorService = new FakeScheduledExecutorService ();
266
244
Timer fakeTimer = spy (new Timer (currentTime ));
267
245
AppStartTrace trace =
268
246
new AppStartTrace (transportManager , clock , configResolver , fakeExecutorService );
269
247
trace .registerActivityLifecycleCallbacks (appContext );
270
- trace .setIsStartFromBackground ();
271
248
trace .setMainThreadRunnableTime (fakeTimer );
272
249
273
250
when (fakeTimer .getDurationMicros ()).thenReturn (99L );
@@ -288,13 +265,12 @@ public void testStartFromBackground_invertedOrder() {
288
265
}
289
266
290
267
@ Test
291
- public void testStartFromBackground_delayedInvertedOrder () {
268
+ public void testStartFromBackground_moreThan100ms () {
292
269
FakeScheduledExecutorService fakeExecutorService = new FakeScheduledExecutorService ();
293
270
Timer fakeTimer = spy (new Timer (currentTime ));
294
271
AppStartTrace trace =
295
272
new AppStartTrace (transportManager , clock , configResolver , fakeExecutorService );
296
273
trace .registerActivityLifecycleCallbacks (appContext );
297
- trace .setIsStartFromBackground ();
298
274
trace .setMainThreadRunnableTime (fakeTimer );
299
275
300
276
when (fakeTimer .getDurationMicros ()).thenReturn (TimeUnit .MILLISECONDS .toMicros (100 ) + 1 );
0 commit comments