| OLD | NEW |
| 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 file I/O. | 5 // Dart test program for testing file I/O. |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 static void asyncTestDone(String name) { | 40 static void asyncTestDone(String name) { |
| 41 asyncEnd(); | 41 asyncEnd(); |
| 42 --numLiveAsyncTests; | 42 --numLiveAsyncTests; |
| 43 if (numLiveAsyncTests == 0) { | 43 if (numLiveAsyncTests == 0) { |
| 44 deleteTempDirectory(); | 44 deleteTempDirectory(); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 static void createTempDirectory(Function doNext) { | 48 static void createTempDirectory(Function doNext) { |
| 49 new Directory('').createTemp().then((temp) { | 49 Directory.createSystemTemp('dart_file').then((temp) { |
| 50 tempDirectory = temp; | 50 tempDirectory = temp; |
| 51 doNext(); | 51 doNext(); |
| 52 }); | 52 }); |
| 53 } | 53 } |
| 54 | 54 |
| 55 static void deleteTempDirectory() { | 55 static void deleteTempDirectory() { |
| 56 tempDirectory.deleteSync(recursive: true); | 56 tempDirectory.deleteSync(recursive: true); |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Test for file read functionality. | 59 // Test for file read functionality. |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 testRenameSync(); | 1301 testRenameSync(); |
| 1302 testLastModified(); | 1302 testLastModified(); |
| 1303 asyncEnd(); | 1303 asyncEnd(); |
| 1304 }); | 1304 }); |
| 1305 } | 1305 } |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 main() { | 1308 main() { |
| 1309 FileTest.testMain(); | 1309 FileTest.testMain(); |
| 1310 } | 1310 } |
| OLD | NEW |