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

Side by Side Diff: tests/standalone/src/io/FileTest.dart

Issue 10173024: Change the error handling in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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/string_stream.dart ('k') | tests/standalone/src/io/HttpServerSocketTest.dart » ('j') | 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 file I/O. 5 // Dart test program for testing file I/O.
6 6
7 #import("dart:io"); 7 #import("dart:io");
8 #import("dart:isolate"); 8 #import("dart:isolate");
9 9
10 class MyListOfOneElement implements List { 10 class MyListOfOneElement implements List {
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 } 839 }
840 Expect.equals(true, exceptionCaught); 840 Expect.equals(true, exceptionCaught);
841 Expect.equals(true, !wrongExceptionCaught); 841 Expect.equals(true, !wrongExceptionCaught);
842 openedFile.closeSync(); 842 openedFile.closeSync();
843 file.deleteSync(); 843 file.deleteSync();
844 } 844 }
845 845
846 static void testOpenDirectoryAsFile() { 846 static void testOpenDirectoryAsFile() {
847 var f = new File('.'); 847 var f = new File('.');
848 f.open(FileMode.READ, (r) => Expect.fail('Directory opened as file')); 848 f.open(FileMode.READ, (r) => Expect.fail('Directory opened as file'));
849 f.onError = (e) => null;
849 } 850 }
850 851
851 static void testOpenDirectoryAsFileSync() { 852 static void testOpenDirectoryAsFileSync() {
852 var f = new File('.'); 853 var f = new File('.');
853 try { 854 try {
854 f.openSync(); 855 f.openSync();
855 Expect.fail("Expected exception opening directory as file"); 856 Expect.fail("Expected exception opening directory as file");
856 } catch (var e) { 857 } catch (var e) {
857 Expect.isTrue(e is FileIOException); 858 Expect.isTrue(e is FileIOException);
858 } 859 }
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 testWriteVariousLists(); 1079 testWriteVariousLists();
1079 testDirectory(); 1080 testDirectory();
1080 testDirectorySync(); 1081 testDirectorySync();
1081 }); 1082 });
1082 } 1083 }
1083 } 1084 }
1084 1085
1085 main() { 1086 main() {
1086 FileTest.testMain(); 1087 FileTest.testMain();
1087 } 1088 }
OLDNEW
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | tests/standalone/src/io/HttpServerSocketTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698