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

Unified Diff: tests/standalone/io/list_output_stream_test.dart

Issue 10832188: Add an OutputStream.closed getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: tests/standalone/io/list_output_stream_test.dart
diff --git a/tests/standalone/io/list_output_stream_test.dart b/tests/standalone/io/list_output_stream_test.dart
index 812c4b3d3a3844b07e00347c682df4150abe2d19..748008bcfaac3690fca6c1c779c05d842b5761b0 100644
--- a/tests/standalone/io/list_output_stream_test.dart
+++ b/tests/standalone/io/list_output_stream_test.dart
@@ -139,6 +139,25 @@ void testListOutputStream4() {
donePort.receive((x,y) => donePort.close());
}
+void testListOutputStream5() {
+ ListOutputStream stream = new ListOutputStream();
+ ReceivePort donePort = new ReceivePort();
+ List result = <int>[];
+
+ stream.onClosed = () {
+ Expect.isTrue(stream.closed);
Bill Hesse 2012/08/08 14:21:11 Why not check the contents here?
nweiz 2012/08/09 19:39:52 Done.
+ donePort.toSendPort().send(null);
+ };
+
+ Expect.isFalse(stream.closed);
+ stream.write([1, 2, 3]);
+ Expect.isFalse(stream.closed);
+ stream.close();
+ Expect.isTrue(stream.closed);
+
Bill Hesse 2012/08/08 14:21:11 Add a test that .write throws an exception here?
nweiz 2012/08/09 19:39:52 Done.
+ donePort.receive((x,y) => donePort.close());
+}
+
main() {
testEmptyListOutputStream1();
testEmptyListOutputStream2();
@@ -146,4 +165,5 @@ main() {
testListOutputStream2();
testListOutputStream3();
testListOutputStream4();
+ testListOutputStream5();
}

Powered by Google App Engine
This is Rietveld 408576698