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

Unified Diff: tests/lib/async/catch_errors12_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_errors11_test.dart ('k') | tests/lib/async/catch_errors13_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors12_test.dart
diff --git a/tests/lib/async/catch_errors12_test.dart b/tests/lib/async/catch_errors12_test.dart
index af4acbc35819c5a7a07e3a853104f6c3a949b580..89528600a8addd2c95a24b7f8ae51a693e0fec15 100644
--- a/tests/lib/async/catch_errors12_test.dart
+++ b/tests/lib/async/catch_errors12_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
// Tests that errors that have been delayed by several milliseconds with
// Timers are still caught by `catchErrors`.
@@ -17,13 +19,19 @@ main() {
Timer.run(() { throw "timer error"; });
new Timer(const Duration(milliseconds: 100), () { throw "timer2 error"; });
new Future.value(499).then((x) {
- new Timer(const Duration(milliseconds: 200), () { throw x; });
+ new Timer(const Duration(milliseconds: 200), () {
+ done.complete(499);
+ throw x;
+ });
});
throw "catch error";
}).listen((x) {
events.add(x);
},
- onDone: () {
+ onDone: () { Expect.fail("Unexpected callback"); });
+ done.future.whenComplete(() {
+ // Give time to execute the callbacks.
+ Timer.run(() {
Expect.listEquals([
"catch error entry",
"main exit",
@@ -35,5 +43,6 @@ main() {
events);
asyncEnd();
});
+ });
events.add("main exit");
}
« no previous file with comments | « tests/lib/async/catch_errors11_test.dart ('k') | tests/lib/async/catch_errors13_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698