Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: tests/lib/async/catch_errors15_test.dart

Issue 23875032: Expose Zones. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/async/catch_errors14_test.dart ('k') | tests/lib/async/catch_errors17_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors15_test.dart
diff --git a/tests/lib/async/catch_errors15_test.dart b/tests/lib/async/catch_errors15_test.dart
index 7e1219dc2f8770659d3fef905d970b8097600984..2f9c13b779ae934323ceb53d812fbe010d4cd3b4 100644
--- a/tests/lib/async/catch_errors15_test.dart
+++ b/tests/lib/async/catch_errors15_test.dart
@@ -9,9 +9,9 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
var events = [];
- // Test that the outer `catchErrors` waits for the nested `catchErrors` stream
- // to be done.
+
catchErrors(() {
events.add("catch error entry");
catchErrors(() {
@@ -23,14 +23,20 @@ main() {
throw "delayed error";
});
throw "catch error";
- }).listen((x) { events.add("i $x"); },
- onDone: () => events.add("inner done"));
+ }).listen((x) {
+ events.add("i $x");
+ if (x == "delayed error") done.complete(true);
+ },
+ onDone: () { Expect.fail("Unexpected callback"); });
events.add("after inner");
throw "inner throw";
}).listen((x) {
events.add("o $x");
},
- onDone: () {
+ onDone: () { Expect.fail("Unexpected callback"); });
+ done.future.whenComplete(() {
+ // Give some time to run the handlers.
+ Timer.run(() {
Expect.listEquals(["catch error entry",
"catch error entry2",
"after inner",
@@ -43,10 +49,10 @@ main() {
"i future error2",
"i 499",
"i delayed error",
- "inner done",
],
events);
asyncEnd();
});
+ });
events.add("main exit");
}
« no previous file with comments | « tests/lib/async/catch_errors14_test.dart ('k') | tests/lib/async/catch_errors17_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698