Chromium Code Reviews| Index: tests/lib/async/catch_errors20_test.dart |
| diff --git a/tests/lib/async/catch_errors20_test.dart b/tests/lib/async/catch_errors20_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c44d20ed37b822c3d7a1f724f2d5749be20cba42 |
| --- /dev/null |
| +++ b/tests/lib/async/catch_errors20_test.dart |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "package:expect/expect.dart"; |
| +import 'dart:async'; |
| +import 'dart:isolate'; |
| + |
| +main() { |
| + // We keep a ReceivePort open until all tests are done. This way the VM will |
| + // time out if the callbacks are not invoked. |
| + var port = new ReceivePort(); |
| + var events = []; |
| + // Test that nested stream (from `catchErrors`) that is delayed by a future |
| + // is waited for. |
| + catchErrors(() { |
| + catchErrors(() { |
| + new Future.error(499); |
| + new Future.delayed(const Duration(milliseconds: 20), () { |
| + events.add(42); |
| + }); |
| + }).listen(events.add, |
| + onDone: () { events.add("done"); }); |
| + throw "foo"; |
| + }).listen((x) { events.add("outer: $x"); }, |
| + onDone: () { |
| + Expect.listEquals([ |
| + 499, |
|
Lasse Reichstein Nielsen
2013/05/29 08:32:26
Indent?
floitsch
2013/05/29 15:48:56
changed like in other tests.
|
| + "outer: foo", |
| + 42, |
| + "done", |
| + ], |
| + events); |
| + port.close(); |
| + }); |
| +} |