@@ -60,7 +60,7 @@ void main() {
6060 }
6161 expect (await f1, isNull);
6262 expect (f2, isNull);
63- });
63+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
6464
6565 test ('TestAsyncUtils - two classes, all callers in superclass' , () async {
6666 final TestAPI testAPI = TestAPISubclass ();
@@ -82,7 +82,7 @@ void main() {
8282 }
8383 expect (await f1, isNull);
8484 expect (f2, isNull);
85- });
85+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
8686
8787 test ('TestAsyncUtils - two classes, mixed callers' , () async {
8888 final TestAPISubclass testAPI = TestAPISubclass ();
@@ -104,7 +104,7 @@ void main() {
104104 }
105105 expect (await f1, isNull);
106106 expect (f2, isNull);
107- });
107+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
108108
109109 test ('TestAsyncUtils - expect() catches pending async work' , () async {
110110 final TestAPI testAPI = TestAPISubclass ();
@@ -126,7 +126,7 @@ void main() {
126126 real_test.expect (lines.length, greaterThan (7 ));
127127 }
128128 expect (await f1, isNull);
129- });
129+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
130130
131131 testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
132132 Future <Object ?>? f1, f2;
@@ -168,7 +168,7 @@ void main() {
168168 }
169169 await f1;
170170 await f2;
171- });
171+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
172172
173173 testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
174174 Future <Object ?>? f1;
@@ -193,7 +193,7 @@ void main() {
193193 real_test.expect (information[3 ].level, DiagnosticLevel .info);
194194 }
195195 await f1;
196- });
196+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
197197
198198 testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
199199 Future <Object ?>? f1;
@@ -218,7 +218,7 @@ void main() {
218218 real_test.expect (information[3 ].level, DiagnosticLevel .info);
219219 }
220220 await f1;
221- });
221+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
222222
223223 testWidgets ('TestAsyncUtils - guard body can throw' , (WidgetTester tester) async {
224224 try {
@@ -229,5 +229,24 @@ void main() {
229229 }
230230 });
231231
232+ test ('TestAsyncUtils - web' , () async {
233+ final TestAPI testAPI = TestAPI ();
234+ Future <Object ?>? f1, f2;
235+ f1 = testAPI.testGuard1 ();
236+ try {
237+ f2 = testAPI.testGuard2 ();
238+ fail ('unexpectedly did not throw' );
239+ } on FlutterError catch (e) {
240+ final List <String > lines = e.message.split ('\n ' );
241+ real_test.expect (lines[0 ], 'Guarded function conflict.' );
242+ real_test.expect (lines[1 ], 'You must use "await" with all Future-returning test APIs.' );
243+ real_test.expect (lines[2 ], '' );
244+ real_test.expect (lines[3 ], 'When the first function was called, this was the stack:' );
245+ real_test.expect (lines.length, greaterThan (3 ));
246+ }
247+ expect (await f1, isNull);
248+ expect (f2, isNull);
249+ }, skip: ! kIsWeb); // [intended] depends on platform-specific stack traces.
250+
232251 // see also dev/manual_tests/test_data which contains tests run by the flutter_tools tests for 'flutter test'
233252}
0 commit comments