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

Side by Side Diff: tests/standalone/io/file_error_test.dart

Issue 10536112: Add missing closed check to random access file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Dart test program for testing error handling in file I/O. 5 // Dart test program for testing error handling in file I/O.
6 6
7 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:isolate"); 8 #import("dart:isolate");
9 9
10 Directory tempDir() { 10 Directory tempDir() {
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 closeFuture.handleException((e) { 483 closeFuture.handleException((e) {
484 Expect.isTrue(e is FileIOException); 484 Expect.isTrue(e is FileIOException);
485 port.send(null); 485 port.send(null);
486 return true; 486 return true;
487 }); 487 });
488 closeFuture.then((ignore) => null); 488 closeFuture.then((ignore) => null);
489 }); 489 });
490 }); 490 });
491 } 491 }
492 492
493 testRepeatedlyCloseFileSync() {
494 createTestFile((file, port) {
495 var openedFile = file.openSync();
496 openedFile.closeSync();
497 Expect.throws(openedFile.closeSync,
498 (e) => e is FileIOException);
499 port.send(null);
500 });
501 }
502
493 main() { 503 main() {
494 testOpenNonExistent(); 504 testOpenNonExistent();
495 testDeleteNonExistent(); 505 testDeleteNonExistent();
496 testLengthNonExistent(); 506 testLengthNonExistent();
497 testCreateInNonExistentDirectory(); 507 testCreateInNonExistentDirectory();
498 testFullPathOnNonExistentDirectory(); 508 testFullPathOnNonExistentDirectory();
499 testDirectoryInNonExistentDirectory(); 509 testDirectoryInNonExistentDirectory();
500 testReadAsBytesNonExistent(); 510 testReadAsBytesNonExistent();
501 testReadAsTextNonExistent(); 511 testReadAsTextNonExistent();
502 testReadAsLinesNonExistent(); 512 testReadAsLinesNonExistent();
503 testWriteByteToReadOnlyFile(); 513 testWriteByteToReadOnlyFile();
504 testWriteListToReadOnlyFile(); 514 testWriteListToReadOnlyFile();
505 testTruncateReadOnlyFile(); 515 testTruncateReadOnlyFile();
506 testOperateOnClosedFile(); 516 testOperateOnClosedFile();
507 testRepeatedlyCloseFile(); 517 testRepeatedlyCloseFile();
518 testRepeatedlyCloseFileSync();
508 } 519 }
OLDNEW
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698