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

Unified Diff: tests/lib/async/catch_errors17_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_errors15_test.dart ('k') | tests/lib/async/catch_errors18_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors17_test.dart
diff --git a/tests/lib/async/catch_errors17_test.dart b/tests/lib/async/catch_errors17_test.dart
index 8cb45c30e2100a130348e5904bc05778be5b8a74..4a1591f59d559790f91f5a8075d3ee9aa57656c2 100644
--- a/tests/lib/async/catch_errors17_test.dart
+++ b/tests/lib/async/catch_errors17_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
StreamController controller;
// Test that errors do not cross zone boundaries.
@@ -23,21 +25,25 @@ main() {
.transform(new StreamTransformer(
handleError: (e, sink) => sink.add("error $e")))
.listen((x) { events.add("stream $x"); });
- }).listen((x) { events.add(x); })
- .asFuture().then((_) { events.add("inner done"); });
+ }).listen((x) { events.add(x); });
controller.add(1);
// Errors are not allowed to traverse boundaries. This error should be
// caught by the outer catchErrors.
controller.addError(2);
controller.close();
- }).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals(["map 1",
- "stream 101",
- "outer: 2",
- "inner done",
- ],
- events);
- asyncEnd();
- });
+ }).listen((x) {
+ events.add("outer: $x");
+ if (x == 2) done.complete(true);
+ }, onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ Timer.run(() {
+ Expect.listEquals(["map 1",
+ "stream 101",
+ "outer: 2",
+ ],
+ events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors15_test.dart ('k') | tests/lib/async/catch_errors18_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698