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

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: Code review changes 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
« no previous file with comments | « tests/standalone/io/file_output_stream_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f8e33bb1028102f2c398829029cf074951bf295a 100644
--- a/tests/standalone/io/list_output_stream_test.dart
+++ b/tests/standalone/io/list_output_stream_test.dart
@@ -139,6 +139,28 @@ void testListOutputStream4() {
donePort.receive((x,y) => donePort.close());
}
+void testListOutputStream5() {
+ ListOutputStream stream = new ListOutputStream();
+ ReceivePort donePort = new ReceivePort();
+
+ stream.onClosed = () {
+ Expect.isTrue(stream.closed);
+ var contents = stream.read();
+ Expect.equals(3, contents.length);
+ for (var i = 0; i < contents.length; i++) Expect.equals(i + 1, contents[i]);
+ donePort.toSendPort().send(null);
+ };
+
+ Expect.isFalse(stream.closed);
+ stream.write([1, 2, 3]);
+ Expect.isFalse(stream.closed);
+ stream.close();
+ Expect.isTrue(stream.closed);
+ Expect.throws(() => stream.write([4, 5, 6]));
+
+ donePort.receive((x,y) => donePort.close());
+}
+
main() {
testEmptyListOutputStream1();
testEmptyListOutputStream2();
@@ -146,4 +168,5 @@ main() {
testListOutputStream2();
testListOutputStream3();
testListOutputStream4();
+ testListOutputStream5();
}
« no previous file with comments | « tests/standalone/io/file_output_stream_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698