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

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

Issue 8883017: Split File into File and RandomAccessFile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 9 years 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/DirectoryTest.dart ('k') | tests/standalone/src/FileInvalidArgumentsTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileInputStreamTest.dart
diff --git a/tests/standalone/src/FileInputStreamTest.dart b/tests/standalone/src/FileInputStreamTest.dart
index 36181cb3e6ca1552fb73617549999387892ff7e9..354c0b53a081a8bed2f0a1b3a4b118fece6101af 100644
--- a/tests/standalone/src/FileInputStreamTest.dart
+++ b/tests/standalone/src/FileInputStreamTest.dart
@@ -12,11 +12,9 @@ void testStringInputStreamSync() {
String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
File file = new File(fileName);
- file.openSync();
StringInputStream x = new StringInputStream(file.openInputStream());
String line = x.readLine();
Expect.equals("Hello Dart", line);
- file.closeSync();
line = x.readLine();
Expect.equals("wassup!", line);
}
@@ -25,9 +23,7 @@ void testInputStreamAsync() {
String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
var expected = "Hello Dart\nwassup!\n".charCodes();
- File file = new File(fileName);
- file.openSync();
- InputStream x = file.openInputStream();
+ InputStream x = (new File(fileName)).openInputStream();
var byteCount = 0;
x.dataHandler = () {
Expect.equals(expected[byteCount], x.read(1)[0]);
@@ -43,7 +39,6 @@ void testStringInputStreamAsync1() {
String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
File file = new File(fileName);
- file.openSync();
StringInputStream x = new StringInputStream(file.openInputStream());
var result = "";
x.dataHandler = () {
@@ -59,7 +54,6 @@ void testStringInputStreamAsync2() {
String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
// File contains "Hello Dart\nwassup!\n"
File file = new File(fileName);
- file.openSync();
StringInputStream x = new StringInputStream(file.openInputStream());
int lineCount = 0;
x.lineHandler = () {
@@ -79,12 +73,10 @@ void testChunkedInputStream() {
String fileName = getFilename("tests/standalone/src/readuntil_test.dat");
// File contains 19 bytes ("Hello Dart\nwassup!")
File file = new File(fileName);
- file.openSync();
ChunkedInputStream x = new ChunkedInputStream(file.openInputStream());
x.chunkSize = 9;
List<int> chunk = x.read();
Expect.equals(9, chunk.length);
- file.closeSync();
x.chunkSize = 5;
chunk = x.read();
Expect.equals(5, chunk.length);
« no previous file with comments | « tests/standalone/src/DirectoryTest.dart ('k') | tests/standalone/src/FileInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698