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

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

Issue 12324004: Add test for whether a completer or stream controller has been closed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/future.dart ('K') | « tests/lib/async/future_test.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_test.dart
diff --git a/tests/lib/async/stream_controller_test.dart b/tests/lib/async/stream_controller_test.dart
index 8cfabf5cbc2304a8f3a74b4c5a215310e06ac4ff..9593e965c8c6393242ff9a779ef5f0de567db30e 100644
--- a/tests/lib/async/stream_controller_test.dart
+++ b/tests/lib/async/stream_controller_test.dart
@@ -392,8 +392,22 @@ testExtraMethods() {
Expect.listEquals(expectedEvents.events, actualEvents.events);
}
+testClosed() {
+ for (StreamController c in [new StreamController(),
+ new StreamController.broadcast()]) {
+ Expect.isFalse(c.isClosed);
+ c.add(42);
+ Expect.isFalse(c.isClosed);
+ c.signalError("bad");
+ Expect.isFalse(c.isClosed);
+ c.close();
+ Expect.isTrue(c.isClosed);
+ }
+}
+
main() {
testMultiController();
testSingleController();
testExtraMethods();
+ testClosed();
}
« sdk/lib/async/future.dart ('K') | « tests/lib/async/future_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698