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

Unified Diff: tests/lib/async/catch_errors19_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_errors18_test.dart ('k') | tests/lib/async/catch_errors20_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors19_test.dart
diff --git a/tests/lib/async/catch_errors19_test.dart b/tests/lib/async/catch_errors19_test.dart
index 1bf558100f5e55a2910662706201728b59d7daa3..8741fe7a97c1b329d75be7c18d4095261ed6321c 100644
--- a/tests/lib/async/catch_errors19_test.dart
+++ b/tests/lib/async/catch_errors19_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);
@@ -21,11 +23,17 @@ main() {
}, onDone: () {
new Future.delayed(const Duration(milliseconds: 30), () {
events.add(499);
+ done.complete(true);
});
});
}).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals([0, 1, 2, 3, 4, 499], events);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ // Give handlers time to run.
+ Timer.run(() {
+ Expect.listEquals([0, 1, 2, 3, 4, 499], events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors18_test.dart ('k') | tests/lib/async/catch_errors20_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698