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

Unified Diff: tests/standalone/src/io/FileErrorTest.dart

Issue 9855012: Fix file error tests on Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/FileErrorTest.dart
diff --git a/tests/standalone/src/io/FileErrorTest.dart b/tests/standalone/src/io/FileErrorTest.dart
index 5ac2c3a914c0619f8a91894c5e8667eefb82a3eb..e85bfb0d69f28467e26c5d5225410a38b20766c5 100644
--- a/tests/standalone/src/io/FileErrorTest.dart
+++ b/tests/standalone/src/io/FileErrorTest.dart
@@ -230,7 +230,7 @@ testWriteByteToReadOnlyFile() {
openedFile.writeByte(0);
openedFile.onError = (e) {
checkWriteReadOnlyFileException(e);
- p.toSendPort().send(null);
+ openedFile.close(() => p.toSendPort().send(null));
};
}
@@ -254,7 +254,7 @@ testWriteListToReadOnlyFile() {
openedFile.writeList(data, 0, data.length);
openedFile.onError = (e) {
checkWriteReadOnlyFileException(e);
- p.toSendPort().send(null);
+ openedFile.close(() => p.toSendPort().send(null));
};
}
@@ -268,7 +268,10 @@ testTruncateReadOnlyFile() {
var file = new File("${temp.path}/test_file");
file.createSync();
- var openedFile = file.openSync(FileMode.READ);
+ var openedFile = file.openSync(FileMode.WRITE);
+ openedFile.writeByteSync(0);
+ openedFile.closeSync();
+ openedFile = file.openSync(FileMode.READ);
// Truncating read only file should throw an exception.
Expect.throws(() => openedFile.truncateSync(0),
@@ -277,7 +280,7 @@ testTruncateReadOnlyFile() {
openedFile.truncate(0, () => Expect.fail("Unreachable code"));
openedFile.onError = (e) {
checkWriteReadOnlyFileException(e);
- p.toSendPort().send(null);
+ openedFile.close(() => p.toSendPort().send(null));
};
}
« 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