Chromium Code Reviews| Index: tests/lib/async/catch_errors15_test.dart |
| diff --git a/tests/lib/async/catch_errors8_test.dart b/tests/lib/async/catch_errors15_test.dart |
| similarity index 55% |
| copy from tests/lib/async/catch_errors8_test.dart |
| copy to tests/lib/async/catch_errors15_test.dart |
| index 74abfb703114f26ddff8e1589cb383672b0e30ef..2d05bdc055bbae6b4be627898c1508a7e41871f7 100644 |
| --- a/tests/lib/async/catch_errors8_test.dart |
| +++ b/tests/lib/async/catch_errors15_test.dart |
| @@ -11,10 +11,8 @@ main() { |
| // hang if the callbacks are not invoked and the test will time out. |
| var port = new ReceivePort(); |
| var events = []; |
| - // Test nested `catchErrors`. |
| - // The nested `catchErrors` throws all kinds of different errors (synchronous |
| - // and asynchronous). The body of the outer `catchErrors` furthermore has a |
| - // synchronous `throw`. |
| + // Test that the outer `catchErrors` waits for the nested `catchErrors` stream |
| + // to be done. |
| catchErrors(() { |
| events.add("catch error entry"); |
| catchErrors(() { |
| @@ -26,30 +24,27 @@ main() { |
| throw "delayed error"; |
| }); |
| throw "catch error"; |
| - }).listen((x) { events.add(x); }) |
| - .asFuture() |
| - .then((_) => events.add("inner done")) |
| - .then((_) { throw "inner done throw"; }); |
| + }).listen((x) { events.add("i $x"); }, |
| + onDone: () => events.add("inner done")); |
| events.add("after inner"); |
| throw "inner throw"; |
| }).listen((x) { |
| - events.add(x); |
| + events.add("o $x"); |
| }, |
| onDone: () { |
| Expect.listEquals(["catch error entry", |
| - "catch error entry2", |
| - "after inner", |
| - "main exit", |
| - "catch error", |
| - "inner throw", |
| - "future error", |
| - "future error2", |
| - 499, |
| - "delayed error", |
| - "inner done", |
| - "inner done throw" |
| - ], |
| - events); |
| + "catch error entry2", |
|
Lasse Reichstein Nielsen
2013/06/13 11:58:47
Space is off-by-one.
floitsch
2013/06/13 13:36:51
Done.
|
| + "after inner", |
| + "main exit", |
| + "i catch error", |
| + "o inner throw", |
| + "i future error", |
| + "i future error2", |
| + "i 499", |
| + "i delayed error", |
| + "inner done", |
| + ], |
| + events); |
| port.close(); |
| }); |
| events.add("main exit"); |