| 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.systemTemp.createTemp('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 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 testLastModified(); | 1325 testLastModified(); |
| 1326 testDoubleAsyncOperation(); | 1326 testDoubleAsyncOperation(); |
| 1327 asyncEnd(); | 1327 asyncEnd(); |
| 1328 }); | 1328 }); |
| 1329 } | 1329 } |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 main() { | 1332 main() { |
| 1333 FileTest.testMain(); | 1333 FileTest.testMain(); |
| 1334 } | 1334 } |
| OLD | NEW |