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

Unified Diff: tests/lib/async/catch_errors27_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_errors26_test.dart ('k') | tests/lib/async/catch_errors28_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors27_test.dart
diff --git a/tests/lib/async/catch_errors27_test.dart b/tests/lib/async/catch_errors27_test.dart
index 23f8b9975bf68043357c62872d7c3ebdacff0c2a..ab89f16b113a7937e7797f24d1ecff0a0f3ec1ad 100644
--- a/tests/lib/async/catch_errors27_test.dart
+++ b/tests/lib/async/catch_errors27_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
StreamController controller;
Stream stream;
@@ -37,19 +39,26 @@ main() {
controller.addError(2);
controller.close();
});
- }).listen((x) { events.add(x); })
- .asFuture().then((_) { events.add("inner done"); });
+ }).listen((x) {
+ events.add(x);
+ if (x == 2) done.complete(true);
+ })
+ .asFuture().then((_) { Expect.fail("Unexpected callback"); });
stream.listen((x) { events.add("stream2 $x"); });
}).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals(["map 1",
- "stream 101",
- "stream2 101",
- "stream error 2",
- 2, // Caught by the inner `catchErrors`.
- "inner done",
- ],
- events);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ // Give handlers time to run.
+ Timer.run(() {
+ Expect.listEquals(["map 1",
+ "stream 101",
+ "stream2 101",
+ "stream error 2",
+ 2, // Caught by the inner `catchErrors`.
+ ],
+ events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors26_test.dart ('k') | tests/lib/async/catch_errors28_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698