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

Unified Diff: test/utils.dart

Issue 1566603002: Add a StreamSinkTransformer class. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Code review changes Created 4 years, 11 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
« no previous file with comments | « test/stream_sink_transformer_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/utils.dart
diff --git a/test/utils.dart b/test/utils.dart
index b2ea885adcf34f30f1a422145069d85feafd3578..0dc47fa1521120b567a89c10adefc3aa3a173928 100644
--- a/test/utils.dart
+++ b/test/utils.dart
@@ -24,3 +24,19 @@ class UnusableStream extends Stream {
throw new UnimplementedError("Gotcha!");
}
}
+
+/// A dummy [StreamSink] for testing the routing of the [done] and [close]
+/// futures.
+///
+/// The [completer] field allows the user to control the future returned by
+/// [done] and [close].
+class CompleterStreamSink<T> implements StreamSink<T> {
+ final completer = new Completer();
+
+ Future get done => completer.future;
+
+ void add(T event) {}
+ void addError(error, [StackTrace stackTrace]) {}
+ Future addStream(Stream<T> stream) async {}
+ Future close() => completer.future;
+}
« no previous file with comments | « test/stream_sink_transformer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698