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

Unified Diff: test/stream_channel_controller_test.dart

Issue 1669953002: Provide more error-handling customization. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Created 4 years, 10 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: test/stream_channel_controller_test.dart
diff --git a/test/stream_channel_controller_test.dart b/test/stream_channel_controller_test.dart
index e45f09062484a7fc37256d9a9bbfb1ace4a2fd86..cf8a31b36dda85fde499fae4973f1c6e26f66ca0 100644
--- a/test/stream_channel_controller_test.dart
+++ b/test/stream_channel_controller_test.dart
@@ -25,6 +25,17 @@ void main() {
controller.foreign.sink..add(1)..add(2)..add(3)..close();
expect(controller.local.stream.toList(), completion(equals([1, 2, 3])));
});
+
+ test("with allowForeignErrors: false, shuts down the connection if an "
+ "error is added to the foreign channel", () {
+ controller = new StreamChannelController(allowForeignErrors: false);
+
+ controller.foreign.sink.addError("oh no");
+ expect(controller.foreign.sink.done, throwsA("oh no"));
+ expect(controller.foreign.stream.toList(), completion(isEmpty));
+ expect(controller.local.sink.done, completes);
+ expect(controller.local.stream.toList(), completion(isEmpty));
+ });
});
group("synchronously", () {

Powered by Google App Engine
This is Rietveld 408576698