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

Unified Diff: pkg/barback/test/stream_replayer_test.dart

Issue 43143002: Avoid sending needless data between isolates in "pub serve" and "pub build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge with bleeding edge Created 7 years, 2 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/barback/test/stream_replayer_test.dart
diff --git a/pkg/barback/test/stream_replayer_test.dart b/pkg/barback/test/stream_replayer_test.dart
index f341a2927fc2005d188b6b70cfd33580285852d9..9bc8224532b95f3bf1e4c722d5c0e1a037307020 100644
--- a/pkg/barback/test/stream_replayer_test.dart
+++ b/pkg/barback/test/stream_replayer_test.dart
@@ -76,4 +76,26 @@ main() {
expect(isClosed, isTrue);
}), completes);
});
+
+ test("the wrapped stream isn't opened if there are no replays", () {
+ var isOpened = false;
+ var controller = new StreamController<int>(onListen: () {
+ isOpened = true;
+ });
+ var replayer = new StreamReplayer<int>(controller.stream);
+
+ expect(pumpEventQueue().then((_) => isOpened), completion(isFalse));
+ });
+
+ test("the wrapped stream isn't opened if no replays are opened", () {
+ var isOpened = false;
+ var controller = new StreamController<int>(onListen: () {
+ isOpened = true;
+ });
+ var replayer = new StreamReplayer<int>(controller.stream);
+ replayer.getReplay();
+ replayer.getReplay();
+
+ expect(pumpEventQueue().then((_) => isOpened), completion(isFalse));
+ });
}

Powered by Google App Engine
This is Rietveld 408576698