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

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

Issue 366813005: Don't consider controller.addError to be a zone-crossing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a new test. Created 6 years, 6 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/async/catch_errors26_test.dart
diff --git a/tests/lib/async/catch_errors26_test.dart b/tests/lib/async/catch_errors26_test.dart
index 1717b24064eaa36835f36cf1511f0ed51168186a..fe69ba355d9b57256bd44db6704ac86f89aa4fe0 100644
--- a/tests/lib/async/catch_errors26_test.dart
+++ b/tests/lib/async/catch_errors26_test.dart
@@ -14,8 +14,7 @@ main() {
var events = [];
StreamController controller;
Stream stream;
- // Test `StreamController.broadcast` streams. Note that the nested listener
- // doesn't see the error, but the outer one does.
+ // Test `StreamController.broadcast` streams.
catchErrors(() {
catchErrors(() {
controller = new StreamController.broadcast();
@@ -32,14 +31,12 @@ main() {
controller.stream.listen((x) { events.add("stream2 $x"); },
onError: (x) { events.add("stream2 error $x"); });
controller.add(1);
- // Errors are not allowed to traverse boundaries, but in this case the
- // first listener of the broadcast stream is in the same error-zone. So
- // this should work.
- controller.addError(2);
+ controller.addError("inner stream");
+ new Future.error("outer error");
controller.close();
}).listen((x) {
events.add("outer: $x");
- if (x == 2) done.complete(true);
+ if (x == "outer error") done.complete(true);
},
onDone: () { Expect.fail("Unexpected callback"); });
@@ -49,8 +46,9 @@ main() {
Expect.listEquals(["map 1",
"stream 101",
"stream2 1",
- "stream2 error 2",
- "outer: 2",
+ "stream error inner stream",
+ "stream2 error inner stream",
+ "outer: outer error",
],
events);
asyncEnd();

Powered by Google App Engine
This is Rietveld 408576698