diff --git a/lib/web_ui/test/engine/history_test.dart b/lib/web_ui/test/engine/history_test.dart index 85dd035656821..e1a0140b6347a 100644 --- a/lib/web_ui/test/engine/history_test.dart +++ b/lib/web_ui/test/engine/history_test.dart @@ -8,7 +8,6 @@ import 'dart:async'; import 'dart:html' as html; -import 'dart:typed_data'; import 'package:test/bootstrap/browser.dart'; import 'package:test/test.dart'; @@ -32,8 +31,6 @@ const Map flutterState = {'flutter': true}; const MethodCodec codec = JSONMethodCodec(); -void emptyCallback(ByteData date) {} - void main() { internalBootstrapBrowserTest(() => testMain); } diff --git a/lib/web_ui/test/window_test.dart b/lib/web_ui/test/window_test.dart index a7c4f3c1e7868..4cb6e96b8f24c 100644 --- a/lib/web_ui/test/window_test.dart +++ b/lib/web_ui/test/window_test.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:html' as html; import 'dart:js_util' as js_util; -import 'dart:typed_data'; import 'package:test/bootstrap/browser.dart'; import 'package:test/test.dart'; @@ -18,8 +17,6 @@ import 'matchers.dart'; const MethodCodec codec = JSONMethodCodec(); -void emptyCallback(ByteData data) {} - void main() { internalBootstrapBrowserTest(() => testMain); } @@ -57,13 +54,15 @@ void testMain() { // Reading it multiple times should return the same value. expect(window.defaultRouteName, '/initial'); expect(window.defaultRouteName, '/initial'); + + Completer callback = Completer(); window.sendPlatformMessage( 'flutter/navigation', JSONMethodCodec().encodeMethodCall(MethodCall( 'routeUpdated', {'routeName': '/bar'}, )), - emptyCallback, + (_) { callback.complete(); }, ); // After a navigation platform message, [window.defaultRouteName] should // reset to "/". @@ -192,7 +191,7 @@ void testMain() { expect(window.browserHistory.currentPath, '/'); // Perform some navigation operations. - routeInformationUpdated('/foo/bar', null); + await routeInformationUpdated('/foo/bar', null); // Path should not be updated because URL strategy is disabled. expect(window.browserHistory.currentPath, '/'); });