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

Unified Diff: tests/lib_strong/async/catch_errors26_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
Index: tests/lib_strong/async/catch_errors26_test.dart
diff --git a/tests/lib_strong/async/catch_errors26_test.dart b/tests/lib_strong/async/catch_errors26_test.dart
index 6d471b8a75c674dbd7099514698d6335a427672e..0d2ea86b316c65a0e2ebf455cc779955ac36cf9b 100644
--- a/tests/lib_strong/async/catch_errors26_test.dart
+++ b/tests/lib_strong/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();
});
});

Powered by Google App Engine
This is Rietveld 408576698