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

Unified Diff: tests/standalone/src/io/FileOutputStreamTest.dart

Issue 9969202: Add method flush to output stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
« runtime/bin/output_stream.dart ('K') | « runtime/bin/socket_stream_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/FileOutputStreamTest.dart
diff --git a/tests/standalone/src/io/FileOutputStreamTest.dart b/tests/standalone/src/io/FileOutputStreamTest.dart
index 89760ecde380a5b8f44cbb07154b3efd44b57a3e..1fc17af580f0656829a76251513684c61d5bc6ad 100644
--- a/tests/standalone/src/io/FileOutputStreamTest.dart
+++ b/tests/standalone/src/io/FileOutputStreamTest.dart
@@ -71,7 +71,36 @@ void testOutputStreamNoPendingWrite() {
}
+void testOutputStreamFlush() {
+ Directory tempDirectory = new Directory('');
+
+ // Create a port for waiting on the final result of this test.
+ ReceivePort done = new ReceivePort();
+ done.receive((message, replyTo) {
+ tempDirectory.deleteSync();
+ done.close();
+ });
+
+ tempDirectory.createTempSync();
+ String fileName = "${tempDirectory.path}/test";
+ File file = new File(fileName);
+ file.createSync();
+ OutputStream x = file.openOutputStream();
+ x.write([65, 66, 67]);
+ x.flush();
+ x.write([68, 69, 70]);
+ x.flush();
+ x.write([71, 72, 73]);
+ x.close();
+ x.onClosed = () {
+ file.deleteSync();
+ done.toSendPort().send("done");
+ };
+}
+
+
main() {
testOpenOutputStreamSync();
testOutputStreamNoPendingWrite();
+ testOutputStreamFlush();
}
« runtime/bin/output_stream.dart ('K') | « runtime/bin/socket_stream_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698