| 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));
|
| };
|
| }
|
|
|
|
|