@@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
5
5
import 'package:flutter_test/flutter_test.dart' ;
6
6
import 'package:mockito/mockito.dart' ;
7
7
import 'package:sentry_flutter/sentry_flutter.dart' ;
8
+ import 'package:sentry_flutter/src/integrations/integrations.dart' ;
8
9
import 'package:sentry_flutter/src/native/sentry_native.dart' ;
9
10
import 'package:sentry/src/sentry_tracer.dart' ;
10
11
import 'package:sentry_flutter/src/navigation/time_to_display_tracker.dart' ;
@@ -383,8 +384,15 @@ void main() {
383
384
verify (span.setData ('route_settings_arguments' , arguments));
384
385
});
385
386
386
- test ('flutter root name is replaced' , () {
387
+ test ('flutter root name is replaced' , () async {
387
388
final rootRoute = route (RouteSettings (name: '/' ));
389
+ NativeAppStartIntegration .setAppStartInfo (
390
+ AppStartInfo (
391
+ AppStartType .cold,
392
+ start: DateTime .now ().add (const Duration (seconds: 1 )),
393
+ end: DateTime .now ().add (const Duration (seconds: 2 )),
394
+ ),
395
+ );
388
396
389
397
final hub = _MockHub ();
390
398
final span = getMockSentryTracer (name: '/' );
@@ -401,6 +409,8 @@ void main() {
401
409
402
410
sut.didPush (rootRoute, null );
403
411
412
+ await Future <void >.delayed (const Duration (milliseconds: 100 ));
413
+
404
414
final context = verify (hub.startTransactionWithContext (
405
415
captureAny,
406
416
waitForChildren: true ,
0 commit comments