| Index: tests/lib/async/run_zoned8_test.dart
|
| diff --git a/tests/lib/async/catch_errors28_test.dart b/tests/lib/async/run_zoned8_test.dart
|
| similarity index 59%
|
| copy from tests/lib/async/catch_errors28_test.dart
|
| copy to tests/lib/async/run_zoned8_test.dart
|
| index a5ce19e1270c89291333580070da82118a7f13b2..c8ce77d9b1ea2bd4b74676453f0ba945cf96c34c 100644
|
| --- a/tests/lib/async/catch_errors28_test.dart
|
| +++ b/tests/lib/async/run_zoned8_test.dart
|
| @@ -5,30 +5,32 @@
|
| import "package:expect/expect.dart";
|
| import 'dart:async';
|
| import 'dart:isolate';
|
| +import 'catch_errors.dart';
|
|
|
| main() {
|
| // We keep a ReceivePort open until all tests are done. This way the VM will
|
| // hang if the callbacks are not invoked and the test will time out.
|
| var port = new ReceivePort();
|
| var events = [];
|
| - // Test that periodic Timers are handled correctly by `catchErrors`.
|
| - catchErrors(() {
|
| + // Test runZoned with periodic Timers.
|
| + runZonedExperimental(() {
|
| int counter = 0;
|
| new Timer.periodic(const Duration(milliseconds: 50), (timer) {
|
| - if (counter == 5) timer.cancel();
|
| + if (counter == 1) timer.cancel();
|
| counter++;
|
| events.add(counter);
|
| + throw counter;
|
| });
|
| - }).listen((x) {
|
| - events.add(x);
|
| - },
|
| - onDone: () {
|
| - Expect.listEquals([
|
| - "main exit",
|
| - 1, 2, 3, 4, 5, 6,
|
| - ],
|
| - events);
|
| - port.close();
|
| - });
|
| + }, onError: (e) {
|
| + events.add("error: $e");
|
| + },
|
| + onDone: () {
|
| + Expect.listEquals([
|
| + "main exit",
|
| + 1, "error: 1", 2, "error: 2",
|
| + ],
|
| + events);
|
| + port.close();
|
| + });
|
| events.add("main exit");
|
| }
|
|
|