| Index: tests/lib/async/future_value_chain2_test.dart
|
| diff --git a/tests/lib/async/run_zoned5_test.dart b/tests/lib/async/future_value_chain2_test.dart
|
| similarity index 52%
|
| copy from tests/lib/async/run_zoned5_test.dart
|
| copy to tests/lib/async/future_value_chain2_test.dart
|
| index 6106a06295ea2686f8f4dc4c3cccc0b43c68befd..3b31c3df3b32ce03410a96a4fb3976a9de3d5c28 100644
|
| --- a/tests/lib/async/run_zoned5_test.dart
|
| +++ b/tests/lib/async/future_value_chain2_test.dart
|
| @@ -6,12 +6,15 @@ import 'package:async_helper/async_helper.dart';
|
| import "package:expect/expect.dart";
|
| import 'dart:async';
|
|
|
| +
|
| main() {
|
| asyncStart();
|
| - // Ensure that `runZoned`'s onError handles synchronous errors.
|
| - runZonedExperimental(() { throw 0; },
|
| - onError: (e) {
|
| - Expect.equals(0, e);
|
| - asyncEnd();
|
| - });
|
| + var errorFuture = new Future.error(499);
|
| + var valueChainFuture = new Future.sync(() => errorFuture);
|
| + // The errorFuture must not be propagated immediately as we would otherwise
|
| + // not have time to catch the error.
|
| + valueChainFuture.catchError((error) {
|
| + Expect.equals(499, error);
|
| + asyncEnd();
|
| + });
|
| }
|
|
|