| Index: tests/lib/async/catch_errors12_test.dart
|
| diff --git a/tests/lib/async/catch_errors12_test.dart b/tests/lib/async/catch_errors12_test.dart
|
| index af4acbc35819c5a7a07e3a853104f6c3a949b580..89528600a8addd2c95a24b7f8ae51a693e0fec15 100644
|
| --- a/tests/lib/async/catch_errors12_test.dart
|
| +++ b/tests/lib/async/catch_errors12_test.dart
|
| @@ -9,6 +9,8 @@ import 'catch_errors.dart';
|
|
|
| main() {
|
| asyncStart();
|
| + Completer done = new Completer();
|
| +
|
| var events = [];
|
| // Tests that errors that have been delayed by several milliseconds with
|
| // Timers are still caught by `catchErrors`.
|
| @@ -17,13 +19,19 @@ main() {
|
| Timer.run(() { throw "timer error"; });
|
| new Timer(const Duration(milliseconds: 100), () { throw "timer2 error"; });
|
| new Future.value(499).then((x) {
|
| - new Timer(const Duration(milliseconds: 200), () { throw x; });
|
| + new Timer(const Duration(milliseconds: 200), () {
|
| + done.complete(499);
|
| + throw x;
|
| + });
|
| });
|
| throw "catch error";
|
| }).listen((x) {
|
| events.add(x);
|
| },
|
| - onDone: () {
|
| + onDone: () { Expect.fail("Unexpected callback"); });
|
| + done.future.whenComplete(() {
|
| + // Give time to execute the callbacks.
|
| + Timer.run(() {
|
| Expect.listEquals([
|
| "catch error entry",
|
| "main exit",
|
| @@ -35,5 +43,6 @@ main() {
|
| events);
|
| asyncEnd();
|
| });
|
| + });
|
| events.add("main exit");
|
| }
|
|
|