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

Unified Diff: tests/standalone/src/FileTest.dart

Issue 9432023: Add both sync and async methods for getting streams for a File (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 10 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/src/FileOutputStreamTest.dart ('k') | tests/standalone/src/ReadIntoConstList.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileTest.dart
diff --git a/tests/standalone/src/FileTest.dart b/tests/standalone/src/FileTest.dart
index b740ca3dd5d9ac06a16ab985aaa47e1805e87354..35a13cdad998dbc00ccd3d6b8a3ae3024c9def2a 100644
--- a/tests/standalone/src/FileTest.dart
+++ b/tests/standalone/src/FileTest.dart
@@ -33,7 +33,7 @@ class FileTest {
// Read a file and check part of it's contents.
String filename = getFilename("bin/file_test.cc");
File file = new File(filename);
- InputStream input = file.openInputStream();
+ InputStream input = file.openInputStreamSync();
List<int> buffer = new List<int>(42);
int bytesRead = input.readInto(buffer, 0, 12);
Expect.equals(12, bytesRead);
@@ -64,7 +64,7 @@ class FileTest {
// Test reading all using readInto.
file = new File(inFilename);
- input = file.openInputStream();
+ input = file.openInputStreamSync();
List<int> buffer1 = new List<int>(42);
bytesRead = input.readInto(buffer1, 0, 42);
Expect.equals(42, bytesRead);
@@ -72,7 +72,7 @@ class FileTest {
// Test reading all using readInto and read.
file = new File(inFilename);
- input = file.openInputStream();
+ input = file.openInputStreamSync();
bytesRead = input.readInto(buffer1, 0, 21);
Expect.equals(21, bytesRead);
buffer1 = input.read();
@@ -81,7 +81,7 @@ class FileTest {
// Test reading all using read and readInto.
file = new File(inFilename);
- input = file.openInputStream();
+ input = file.openInputStreamSync();
buffer1 = input.read(21);
Expect.equals(21, buffer1.length);
bytesRead = input.readInto(buffer1, 0, 21);
@@ -90,7 +90,7 @@ class FileTest {
// Test reading all using read.
file = new File(inFilename);
- input = file.openInputStream();
+ input = file.openInputStreamSync();
buffer1 = input.read();
Expect.equals(42, buffer1.length);
Expect.isTrue(input.closed);
@@ -98,7 +98,7 @@ class FileTest {
// Write the contents of the file just read into another file.
String outFilename = tempDirectory.path + "/out_read_write_stream";
file = new File(outFilename);
- OutputStream output = file.openOutputStream();
+ OutputStream output = file.openOutputStreamSync();
bool writeDone = output.writeFrom(buffer1, 0, 42);
Expect.equals(true, writeDone);
output.close();
@@ -106,7 +106,7 @@ class FileTest {
// Now read the contents of the file just written.
List<int> buffer2 = new List<int>(42);
file = new File(outFilename);
- input = file.openInputStream();
+ input = file.openInputStreamSync();
bytesRead = input.readInto(buffer2, 0, 42);
Expect.isTrue(input.closed);
Expect.equals(42, bytesRead);
@@ -292,11 +292,11 @@ class FileTest {
File file = new File(filename);
file.createSync();
List<int> buffer = content.charCodes();
- OutputStream outStream = file.openOutputStream();
+ OutputStream outStream = file.openOutputStreamSync();
outStream.write(buffer);
outStream.close();
File file2 = new File(filename);
- OutputStream appendingOutput = file2.openOutputStream(FileMode.APPEND);
+ OutputStream appendingOutput = file2.openOutputStreamSync(FileMode.APPEND);
appendingOutput.write(buffer);
appendingOutput.close();
File file3 = new File(filename);
@@ -611,10 +611,10 @@ class FileTest {
List<int> buffer = new List<int>(42);
File file = new File(tempDirectory.path + "/out_close_exception_stream");
file.createSync();
- InputStream input = file.openInputStream();
+ InputStream input = file.openInputStreamSync();
Expect.isTrue(input.closed);
Expect.isNull(input.readInto(buffer, 0, 12));
- OutputStream output = file.openOutputStream();
+ OutputStream output = file.openOutputStreamSync();
output.close();
Expect.throws(( ) => output.writeFrom(buffer, 0, 12),
(e) => e is FileIOException);
« no previous file with comments | « tests/standalone/src/FileOutputStreamTest.dart ('k') | tests/standalone/src/ReadIntoConstList.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698