Index: tests/lib/async/catch_errors26_test.dart |
diff --git a/tests/lib/async/catch_errors26_test.dart b/tests/lib/async/catch_errors26_test.dart |
index 6d471b8a75c674dbd7099514698d6335a427672e..0d2ea86b316c65a0e2ebf455cc779955ac36cf9b 100644 |
--- a/tests/lib/async/catch_errors26_test.dart |
+++ b/tests/lib/async/catch_errors26_test.dart |
@@ -20,21 +20,30 @@ main() { |
controller = new StreamController.broadcast(); |
// Listen to the stream from the inner zone. |
- controller.stream |
- .map((x) { |
- events.add("map $x"); |
- return x + 100; |
+ controller.stream.map((x) { |
+ events.add("map $x"); |
+ return x + 100; |
+ }).transform( |
+ new StreamTransformer.fromHandlers(handleError: (e, st, sink) { |
+ sink.add("error $e"); |
+ })).listen((x) { |
+ events.add("stream $x"); |
+ }); |
+ }) |
+ .listen((x) { |
+ events.add(x); |
}) |
- .transform(new StreamTransformer.fromHandlers( |
- handleError: (e, st, sink) { sink.add("error $e"); })) |
- .listen((x) { events.add("stream $x"); }); |
- |
- }).listen((x) { events.add(x); }) |
- .asFuture().then((_) { Expect.fail("Unexpected callback"); }); |
+ .asFuture() |
+ .then((_) { |
+ Expect.fail("Unexpected callback"); |
+ }); |
// Listen to the stream from the outer zone. |
- controller.stream.listen((x) { events.add("stream2 $x"); }, |
- onError: (x) { events.add("stream2 error $x"); }); |
+ controller.stream.listen((x) { |
+ events.add("stream2 $x"); |
+ }, onError: (x) { |
+ events.add("stream2 error $x"); |
+ }); |
// Feed the controller. |
controller.add(1); |
@@ -42,22 +51,23 @@ main() { |
new Future.error("outer error"); |
controller.close(); |
}).listen((x) { |
- events.add("outer: $x"); |
- if (x == "outer error") done.complete(true); |
- }, |
- onDone: () { Expect.fail("Unexpected callback"); }); |
+ events.add("outer: $x"); |
+ if (x == "outer error") done.complete(true); |
+ }, onDone: () { |
+ Expect.fail("Unexpected callback"); |
+ }); |
done.future.whenComplete(() { |
// Give handlers time to run. |
Timer.run(() { |
- Expect.listEquals(["map 1", |
- "stream 101", |
- "stream2 1", |
- "stream error inner stream", |
- "stream2 error inner stream", |
- "outer: outer error", |
- ], |
- events); |
+ Expect.listEquals([ |
+ "map 1", |
+ "stream 101", |
+ "stream2 1", |
+ "stream error inner stream", |
+ "stream2 error inner stream", |
+ "outer: outer error", |
+ ], events); |
asyncEnd(); |
}); |
}); |