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

Unified Diff: tests/lib/async/catch_errors25_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_errors24_test.dart ('k') | tests/lib/async/catch_errors26_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors25_test.dart
diff --git a/tests/lib/async/catch_errors25_test.dart b/tests/lib/async/catch_errors25_test.dart
index 2360e9ad8bf460a6ef3e2e9bb99676759a719861..f3e9c0e3f34aa075ef866cc9b39a1d9a745d678a 100644
--- a/tests/lib/async/catch_errors25_test.dart
+++ b/tests/lib/async/catch_errors25_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
StreamController controller;
// Test multiple subscribers of an asBroadcastStream inside the same
@@ -17,9 +19,15 @@ main() {
var stream = new Stream.fromIterable([1, 2]).asBroadcastStream();
stream.listen(events.add);
stream.listen(events.add);
+ done.complete(stream.listen(null).asFuture());
}).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals([1, 1, 2, 2], events);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ // Give handlers time to run.
+ Timer.run(() {
+ Expect.listEquals([1, 1, 2, 2], events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors24_test.dart ('k') | tests/lib/async/catch_errors26_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698