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

Unified Diff: tests/lib/async/catch_errors18_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_errors17_test.dart ('k') | tests/lib/async/catch_errors19_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors18_test.dart
diff --git a/tests/lib/async/catch_errors18_test.dart b/tests/lib/async/catch_errors18_test.dart
index 5d04a57d75e10120fbdd933aff1306419d5f5d9d..a2751768145cf202846f617e04b077d84d413701 100644
--- a/tests/lib/async/catch_errors18_test.dart
+++ b/tests/lib/async/catch_errors18_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
Stream stream = new Stream.periodic(const Duration(milliseconds: 20),
(x) => x);
@@ -19,13 +21,19 @@ main() {
if (x == 5) {
events.add("cancel");
subscription.cancel();
+ done.complete(true);
return;
}
events.add(x);
});
}).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals([0, 1, 2, 3, 4, "cancel"], events);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ // Give handlers time to run.
+ Timer.run(() {
+ Expect.listEquals([0, 1, 2, 3, 4, "cancel"], events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors17_test.dart ('k') | tests/lib/async/catch_errors19_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698