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

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

Issue 808713003: Remove barback from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « pkg/barback/test/stream_pool_test.dart ('k') | pkg/barback/test/too_many_open_files_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index 802db14f663c9c3921163d75e5b245a8eae82515..0000000000000000000000000000000000000000
--- a/pkg/barback/test/stream_replayer_test.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library barback.test.stream_replayer_test;
-
-import 'dart:async';
-
-import 'package:barback/src/utils.dart';
-import 'package:barback/src/utils/stream_replayer.dart';
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
-
-main() {
- initConfig();
-
- test("a replay that's retrieved before the stream is finished replays the "
- "stream", () {
- var controller = new StreamController<int>();
- var replay = new StreamReplayer<int>(controller.stream).getReplay();
-
- controller.add(1);
- controller.add(2);
- controller.add(3);
- controller.close();
-
- expect(replay.toList(), completion(equals([1, 2, 3])));
- });
-
- test("a replay that's retrieved after the stream is finished replays the "
- "stream", () {
- var controller = new StreamController<int>();
- var replayer = new StreamReplayer<int>(controller.stream);
-
- controller.add(1);
- controller.add(2);
- controller.add(3);
- controller.close();
-
- expect(replayer.getReplay().toList(), completion(equals([1, 2, 3])));
- });
-
- test("multiple replays each replay the stream", () {
- var controller = new StreamController<int>();
- var replayer = new StreamReplayer<int>(controller.stream);
-
- var replay1 = replayer.getReplay();
- controller.add(1);
- controller.add(2);
- controller.add(3);
- controller.close();
- var replay2 = replayer.getReplay();
-
- expect(replay1.toList(), completion(equals([1, 2, 3])));
- expect(replay2.toList(), completion(equals([1, 2, 3])));
- });
-
- test("the replayed stream doesn't close until the source stream closes", () {
- var controller = new StreamController<int>();
- var replay = new StreamReplayer<int>(controller.stream).getReplay();
- var isClosed = false;
- replay.last.then((_) {
- isClosed = true;
- });
-
- controller.add(1);
- controller.add(2);
- controller.add(3);
-
- expect(pumpEventQueue().then((_) {
- expect(isClosed, isFalse);
- controller.close();
- return pumpEventQueue();
- }).then((_) {
- 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));
- });
-}
« no previous file with comments | « pkg/barback/test/stream_pool_test.dart ('k') | pkg/barback/test/too_many_open_files_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698