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

Unified Diff: tests/lib/async/catch_errors24_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_errors23_test.dart ('k') | tests/lib/async/catch_errors25_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/catch_errors24_test.dart
diff --git a/tests/lib/async/catch_errors24_test.dart b/tests/lib/async/catch_errors24_test.dart
index c9d6e4b2132cbab089f0d7f164175730427e9bb2..675d3a1c97d175bc68ba32f16aaa452c7de9b1d9 100644
--- a/tests/lib/async/catch_errors24_test.dart
+++ b/tests/lib/async/catch_errors24_test.dart
@@ -9,6 +9,8 @@ import 'catch_errors.dart';
main() {
asyncStart();
+ Completer done = new Completer();
+
var events = [];
StreamController controller;
Stream stream;
@@ -26,9 +28,14 @@ main() {
.transform(new StreamTransformer(
handleError: (e, sink) => sink.add("error $e")))
.asBroadcastStream();
- runAsync(() { stream.listen((x) { events.add("stream $x"); }); });
+ runAsync(() {
+ stream.listen((x) {
+ events.add("stream $x");
+ if (x == "error 2") done.complete(true);
+ });
+ });
}).listen((x) { events.add(x); })
- .asFuture().then((_) { events.add("inner done"); });
+ .asFuture().then((_) { Expect.fail("Unexpected callback"); });
stream.listen((x) { events.add("stream2 $x"); });
runAsync(() {
controller.add(1);
@@ -39,15 +46,19 @@ main() {
controller.close();
});
}).listen((x) { events.add("outer: $x"); },
- onDone: () {
- Expect.listEquals(["map 1",
- "stream2 101",
- "stream 101",
- "stream2 error 2",
- "stream error 2",
- "inner done",
- ],
- events);
- asyncEnd();
- });
+ onDone: () { Expect.fail("Unexpected callback"); });
+
+ done.future.whenComplete(() {
+ // Give handlers time to complete.
+ Timer.run(() {
+ Expect.listEquals(["map 1",
+ "stream2 101",
+ "stream 101",
+ "stream2 error 2",
+ "stream error 2",
+ ],
+ events);
+ asyncEnd();
+ });
+ });
}
« no previous file with comments | « tests/lib/async/catch_errors23_test.dart ('k') | tests/lib/async/catch_errors25_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698