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

Unified Diff: tests/lib/async/stream_controller_async_test.dart

Issue 15999002: Add Stream.drain() method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
« sdk/lib/async/stream.dart ('K') | « sdk/lib/async/stream.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_controller_async_test.dart
diff --git a/tests/lib/async/stream_controller_async_test.dart b/tests/lib/async/stream_controller_async_test.dart
index 9d88104f0a150cabf6fdb2fcbd7556c4cc2ac2e5..e2aab21d6da40b916a4f6d232e33b0ff1c487c7d 100644
--- a/tests/lib/async/stream_controller_async_test.dart
+++ b/tests/lib/async/stream_controller_async_test.dart
@@ -295,6 +295,22 @@ testExtraMethods() {
f.catchError(expectAsync1((error) { Expect.isTrue(error is StateError); }));
sentEvents.replay(c);
});
+
+ test("drain", () {
+ StreamController c = new StreamController();
+ Future f = c.stream.drain();
+ f.then(expectAsync1((v) { Expect.equals(null, v);}));
+ sentEvents.replay(c);
+ });
+
+ test("drain error", () {
+ StreamController c = new StreamController();
+ Future f = c.stream.drain();
+ f.catchError(expectAsync1((error) { Expect.equals("error", error); }));
+ Events errorEvents = new Events()..error("error")..error("error2")..close();
+ errorEvents.replay(c);
+ });
+
}
testPause() {
@@ -459,6 +475,7 @@ testRethrow() {
testFuture("any", (s, act) => s.any(act));
testFuture("reduce", (s, act) => s.reduce((a,b) => act(b)));
testFuture("fold", (s, act) => s.fold(0, (a,b) => act(b)));
+ testFuture("drain", (s, act) => s.drain().then(act));
}
main() {
« sdk/lib/async/stream.dart ('K') | « sdk/lib/async/stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698