@@ -60,7 +60,7 @@ void main() {
60
60
}
61
61
expect (await f1, isNull);
62
62
expect (f2, isNull);
63
- });
63
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
64
64
65
65
test ('TestAsyncUtils - two classes, all callers in superclass' , () async {
66
66
final TestAPI testAPI = TestAPISubclass ();
@@ -82,7 +82,7 @@ void main() {
82
82
}
83
83
expect (await f1, isNull);
84
84
expect (f2, isNull);
85
- });
85
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
86
86
87
87
test ('TestAsyncUtils - two classes, mixed callers' , () async {
88
88
final TestAPISubclass testAPI = TestAPISubclass ();
@@ -104,7 +104,7 @@ void main() {
104
104
}
105
105
expect (await f1, isNull);
106
106
expect (f2, isNull);
107
- });
107
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
108
108
109
109
test ('TestAsyncUtils - expect() catches pending async work' , () async {
110
110
final TestAPI testAPI = TestAPISubclass ();
@@ -126,7 +126,7 @@ void main() {
126
126
real_test.expect (lines.length, greaterThan (7 ));
127
127
}
128
128
expect (await f1, isNull);
129
- });
129
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
130
130
131
131
testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
132
132
Future <Object ?>? f1, f2;
@@ -168,7 +168,7 @@ void main() {
168
168
}
169
169
await f1;
170
170
await f2;
171
- });
171
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
172
172
173
173
testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
174
174
Future <Object ?>? f1;
@@ -193,7 +193,7 @@ void main() {
193
193
real_test.expect (information[3 ].level, DiagnosticLevel .info);
194
194
}
195
195
await f1;
196
- });
196
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
197
197
198
198
testWidgets ('TestAsyncUtils - expect() catches pending async work' , (WidgetTester tester) async {
199
199
Future <Object ?>? f1;
@@ -218,7 +218,7 @@ void main() {
218
218
real_test.expect (information[3 ].level, DiagnosticLevel .info);
219
219
}
220
220
await f1;
221
- });
221
+ }, skip : kIsWeb); // [intended] depends on platform-specific stack traces.
222
222
223
223
testWidgets ('TestAsyncUtils - guard body can throw' , (WidgetTester tester) async {
224
224
try {
@@ -229,5 +229,24 @@ void main() {
229
229
}
230
230
});
231
231
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
+
232
251
// see also dev/manual_tests/test_data which contains tests run by the flutter_tools tests for 'flutter test'
233
252
}
0 commit comments