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

Unified Diff: pkg/scheduled_test/lib/src/utils.dart

Issue 14136004: Remove StreamController.broadcast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: pkg/scheduled_test/lib/src/utils.dart
diff --git a/pkg/scheduled_test/lib/src/utils.dart b/pkg/scheduled_test/lib/src/utils.dart
index 419e47eb8bc30e224f997cd5920922b9f844a36d..931c28b4a95ffba0cc8b2c473e695d17b5eaf310 100644
--- a/pkg/scheduled_test/lib/src/utils.dart
+++ b/pkg/scheduled_test/lib/src/utils.dart
@@ -122,15 +122,16 @@ typedef void StreamCanceller();
/// the wrapped stream. Unlike [StreamSubscription], this canceller will send a
/// "done" message to the wrapped stream.
Pair<Stream, StreamCanceller> streamWithCanceller(Stream stream) {
- var controller = stream.isBroadcast ?
- new StreamController.broadcast() :
- new StreamController();
+ var controller = new StreamController();
+ var controllerStream = stream.isBroadcast ?
+ controller.stream.asBroadcastStream() :
+ controller.stream;
var subscription = stream.listen((value) {
if (!controller.isClosed) controller.add(value);
}, onError: (error) {
if (!controller.isClosed) controller.signalError(error);
}, onDone: controller.close);
- return new Pair<Stream, StreamCanceller>(controller.stream, controller.close);
+ return new Pair<Stream, StreamCanceller>(controllerStream, controller.close);
}
// TODO(nweiz): remove this when issue 7787 is fixed.
« no previous file with comments | « no previous file | sdk/lib/async/stream_controller.dart » ('j') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('J')

Powered by Google App Engine
This is Rietveld 408576698