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

Side by Side Diff: tests/standalone/io/file_output_stream_test.dart

Issue 10670003: IO: The test standalone/io/file_output_stream_test.dart would leave a directory in /tmp. Fixed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Testing file input stream, VM-only, standalone test. 4 // Testing file input stream, VM-only, standalone test.
5 5
6 #import("dart:io"); 6 #import("dart:io");
7 #import("dart:isolate"); 7 #import("dart:isolate");
8 8
9 void testOpenOutputStreamSync() { 9 void testOpenOutputStreamSync() {
10 Directory tempDirectory = new Directory('').createTempSync(); 10 Directory tempDirectory = new Directory('').createTempSync();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void testOutputStreamFlush() { 72 void testOutputStreamFlush() {
73 Directory tempDirectory = new Directory('').createTempSync(); 73 Directory tempDirectory = new Directory('').createTempSync();
74 74
75 // Create a port for waiting on the final result of this test. 75 // Create a port for waiting on the final result of this test.
76 ReceivePort done = new ReceivePort(); 76 ReceivePort done = new ReceivePort();
77 done.receive((message, replyTo) { 77 done.receive((message, replyTo) {
78 tempDirectory.deleteSync(); 78 tempDirectory.deleteSync();
79 done.close(); 79 done.close();
80 }); 80 });
81 81
82 tempDirectory.createTempSync();
83 String fileName = "${tempDirectory.path}/test"; 82 String fileName = "${tempDirectory.path}/test";
84 File file = new File(fileName); 83 File file = new File(fileName);
85 file.createSync(); 84 file.createSync();
86 OutputStream x = file.openOutputStream(); 85 OutputStream x = file.openOutputStream();
87 x.write([65, 66, 67]); 86 x.write([65, 66, 67]);
88 x.flush(); 87 x.flush();
89 x.write([68, 69, 70]); 88 x.write([68, 69, 70]);
90 x.flush(); 89 x.flush();
91 x.write([71, 72, 73]); 90 x.write([71, 72, 73]);
92 x.onClosed = () { 91 x.onClosed = () {
93 file.deleteSync(); 92 file.deleteSync();
94 done.toSendPort().send("done"); 93 done.toSendPort().send("done");
95 }; 94 };
96 x.close(); 95 x.close();
97 x.onError = (e) => Expect.fail("No error expected"); 96 x.onError = (e) => Expect.fail("No error expected");
98 } 97 }
99 98
100 main() { 99 main() {
101 testOpenOutputStreamSync(); 100 testOpenOutputStreamSync();
102 testOutputStreamNoPendingWrite(); 101 testOutputStreamNoPendingWrite();
103 testOutputStreamFlush(); 102 testOutputStreamFlush();
104 } 103 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698