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

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

Issue 8437056: Implemented File create API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | « runtime/bin/process_script.cc ('k') | no next file » | 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 ca6a8ccd81c86c5b27a2f256427e1fa5d9bb773f..64f90f67d1e504e0b9a7b728ba72c0773101861c 100644
--- a/tests/standalone/src/FileTest.dart
+++ b/tests/standalone/src/FileTest.dart
@@ -143,37 +143,40 @@ class FileTest {
file.errorHandler = (s) {
Expect.fail("No errors expected");
};
- file.openHandler = () {
- file.noPendingWriteHandler = () {
- file.closeHandler = () {
- // Now read the contents of the file just written.
- List<int> buffer2 = new List<int>(bytes_read);
- file = new File(getFilename(outFilenameBase));
- file.errorHandler = (s) {
- Expect.fail("No errors expected");
- };
- file.openHandler = () {
- file.readListHandler = (bytes_read) {
- Expect.equals(42, bytes_read);
- file.closeHandler = () {
- // Now compare the two buffers to check if they
- // are identical.
- Expect.equals(buffer1.length, buffer2.length);
- for (int i = 0; i < buffer1.length; i++) {
- Expect.equals(buffer1[i], buffer2[i]);
- }
+ file.createHandler = () {
+ file.openHandler = () {
+ file.noPendingWriteHandler = () {
+ file.closeHandler = () {
+ // Now read the contents of the file just written.
+ List<int> buffer2 = new List<int>(bytes_read);
+ file = new File(getFilename(outFilenameBase));
+ file.errorHandler = (s) {
+ Expect.fail("No errors expected");
+ };
+ file.openHandler = () {
+ file.readListHandler = (bytes_read) {
+ Expect.equals(42, bytes_read);
+ file.closeHandler = () {
+ // Now compare the two buffers to check if they
+ // are identical.
+ Expect.equals(buffer1.length, buffer2.length);
+ for (int i = 0; i < buffer1.length; i++) {
+ Expect.equals(buffer1[i], buffer2[i]);
+ }
+ };
+ file.close();
};
- file.close();
+ file.readList(buffer2, 0, 42);
};
- file.readList(buffer2, 0, 42);
+ file.open();
};
- file.open();
+ file.close();
};
- file.close();
+ file.writeList(buffer1, 0, bytes_read);
};
- file.writeList(buffer1, 0, bytes_read);
+ file.open(true);
};
- file.open(true);
+ file.create();
};
file.close();
};
@@ -198,6 +201,7 @@ class FileTest {
// Write the contents of the file just read into another file.
String outFilenameBase = getFilename("tests/vm/data/fixed_length_file");
file = new File(outFilenameBase + "_out");
+ file.createSync();
file.openSync(true);
file.writeListSync(buffer1, 0, bytes_read);
file.closeSync();
« no previous file with comments | « runtime/bin/process_script.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698