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

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

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding stable test binaries Created 8 years, 7 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/file_output_stream_test.dart
diff --git a/tests/standalone/io/file_output_stream_test.dart b/tests/standalone/io/file_output_stream_test.dart
index 89760ecde380a5b8f44cbb07154b3efd44b57a3e..ee3a0e87aafc485771511c3ec1232379f568ae14 100644
--- a/tests/standalone/io/file_output_stream_test.dart
+++ b/tests/standalone/io/file_output_stream_test.dart
@@ -7,7 +7,7 @@
#import("dart:isolate");
void testOpenOutputStreamSync() {
- Directory tempDirectory = new Directory('');
+ Directory tempDirectory = new Directory('').createTempSync();
// Create a port for waiting on the final result of this test.
ReceivePort done = new ReceivePort();
@@ -16,7 +16,6 @@ void testOpenOutputStreamSync() {
done.close();
});
- tempDirectory.createTempSync();
String fileName = "${tempDirectory.path}/test";
File file = new File(fileName);
file.createSync();
@@ -31,20 +30,19 @@ void testOpenOutputStreamSync() {
void testOutputStreamNoPendingWrite() {
- Directory tempDirectory = new Directory('');
+ var tempDirectory;
// Create a port for waiting on the final result of this test.
ReceivePort done = new ReceivePort();
done.receive((message, replyTo) {
- tempDirectory.deleteRecursively(() {
- done.close();
- });
+ tempDirectory.deleteRecursively().then((ignore) => done.close());
});
- tempDirectory.createTemp(() {
+ new Directory('').createTemp().then((temp) {
+ tempDirectory = temp;
String fileName = "${tempDirectory.path}/test";
File file = new File(fileName);
- file.create(() {
+ file.create().then((ignore) {
OutputStream stream = file.openOutputStream();
final total = 100;
var count = 0;
« no previous file with comments | « tests/standalone/io/file_invalid_arguments_test.dart ('k') | tests/standalone/io/file_system_links_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698