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

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

Issue 25471003: Modify tests to use Directory.systemTemp (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 7 years, 2 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 | « tests/standalone/io/directory_test.dart ('k') | tests/standalone/io/file_fuzz_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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:convert"; 7 import "dart:convert";
8 import "dart:io"; 8 import "dart:io";
9 9
10 import "package:async_helper/async_helper.dart"; 10 import "package:async_helper/async_helper.dart";
11 import "package:expect/expect.dart"; 11 import "package:expect/expect.dart";
12 12
13 Directory tempDir() { 13 Directory tempDir() {
14 return new Directory('').createTempSync(); 14 return Directory.systemTemp.createTempSync('dart_file_error');
15 } 15 }
16 16
17 17
18 bool checkNonExistentFileException(e, str) { 18 bool checkNonExistentFileException(e, str) {
19 Expect.isTrue(e is FileException); 19 Expect.isTrue(e is FileException);
20 Expect.isTrue(e.osError != null); 20 Expect.isTrue(e.osError != null);
21 Expect.isTrue(e.toString().indexOf(str) != -1); 21 Expect.isTrue(e.toString().indexOf(str) != -1);
22 // File not not found has error code 2 on all supported platforms. 22 // File not not found has error code 2 on all supported platforms.
23 Expect.equals(2, e.osError.errorCode); 23 Expect.equals(2, e.osError.errorCode);
24 return true; 24 return true;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 testReadAsLinesNonExistent(); 430 testReadAsLinesNonExistent();
431 testWriteByteToReadOnlyFile(); 431 testWriteByteToReadOnlyFile();
432 testWriteFromToReadOnlyFile(); 432 testWriteFromToReadOnlyFile();
433 testTruncateReadOnlyFile(); 433 testTruncateReadOnlyFile();
434 testOperateOnClosedFile(); 434 testOperateOnClosedFile();
435 testRepeatedlyCloseFile(); 435 testRepeatedlyCloseFile();
436 testRepeatedlyCloseFileSync(); 436 testRepeatedlyCloseFileSync();
437 testReadSyncBigInt(); 437 testReadSyncBigInt();
438 testReadSyncClosedFile(); 438 testReadSyncClosedFile();
439 } 439 }
OLDNEW
« no previous file with comments | « tests/standalone/io/directory_test.dart ('k') | tests/standalone/io/file_fuzz_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698