@@ -21,14 +21,14 @@ import 'test_helpers.dart';
2121const  bool  enableLogs =  false ;
2222final  Logger  log =  Logger ('GoRouter tests' );
2323
24- Future <void > sendPlatformUrl (String  url) async  {
24+ Future <void > sendPlatformUrl (String  url,  WidgetTester  tester ) async  {
2525  final  Map <String , dynamic > testRouteInformation =  < String , dynamic > {
2626    'location' :  url,
2727  };
2828  final  ByteData  message =  const  JSONMethodCodec ().encodeMethodCall (
2929    MethodCall ('pushRouteInformation' , testRouteInformation),
3030  );
31-   await  ServicesBinding .instance .defaultBinaryMessenger
31+   await  tester.binding .defaultBinaryMessenger
3232      .handlePlatformMessage ('flutter/navigation' , message, (_) {});
3333}
3434
@@ -1495,7 +1495,7 @@ void main() {
14951495
14961496      redirected =  false ;
14971497      // Directly set the url through platform message. 
1498-       await  sendPlatformUrl ('/dummy' );
1498+       await  sendPlatformUrl ('/dummy' , tester );
14991499
15001500      await  tester.pumpAndSettle ();
15011501      expect (router.location, '/login' );
@@ -1528,7 +1528,7 @@ void main() {
15281528
15291529      expect (router.location, '/' );
15301530      // Directly set the url through platform message. 
1531-       await  sendPlatformUrl ('/dummy' );
1531+       await  sendPlatformUrl ('/dummy' , tester );
15321532      await  tester.pumpAndSettle ();
15331533      expect (router.location, '/dummy' );
15341534    });
@@ -1631,7 +1631,7 @@ void main() {
16311631      });
16321632      redirected =  false ;
16331633      // Directly set the url through platform message. 
1634-       await  sendPlatformUrl ('/dummy' );
1634+       await  sendPlatformUrl ('/dummy' , tester );
16351635
16361636      await  tester.pumpAndSettle ();
16371637      expect (router.location, '/login' );
@@ -2024,7 +2024,7 @@ void main() {
20242024      final  GoRouter  router =  await  createRouter (routes, tester);
20252025
20262026      // Directly set the url through platform message. 
2027-       await  sendPlatformUrl ('/dummy/dummy2' );
2027+       await  sendPlatformUrl ('/dummy/dummy2' , tester );
20282028
20292029      await  tester.pumpAndSettle ();
20302030      expect (router.location, '/other' );
0 commit comments