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

Unified Diff: tests/lib/async/catch_errors8_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_errors7_test.dart ('k') | tests/lib/async/catch_errors9_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors8_test.dart
diff --git a/tests/lib/async/catch_errors8_test.dart b/tests/lib/async/catch_errors8_test.dart
index 7519fc684bae9bd9c20033098df787f06f62da50..3390046c39a1302abcb90c4925d751b33cc18af2 100644
--- a/tests/lib/async/catch_errors8_test.dart
+++ b/tests/lib/async/catch_errors8_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
// Test nested `catchErrors`.
// The nested `catchErrors` throws all kinds of different errors (synchronous
@@ -25,31 +27,37 @@ 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(x);
+ if (x == "delayed error") {
+ throw "inner done throw";
+ }
+ });
events.add("after inner");
throw "inner throw";
}).listen((x) {
events.add(x);
+ if (x == "inner done throw") {
+ done.complete(true);
+ }
},
- 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);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ 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 throw"
+ ],
+ events);
+ asyncEnd();
+ });
events.add("main exit");
}
« no previous file with comments | « tests/lib/async/catch_errors7_test.dart ('k') | tests/lib/async/catch_errors9_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698