| OLD | NEW |
| 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 // Directory listing test. | 5 // Directory listing test. |
| 6 | 6 |
| 7 import "dart:async"; | 7 import "dart:async"; |
| 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"; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 Directory.systemTemp.createTemp('dart_directory').then((d) { | 118 Directory.systemTemp.createTemp('dart_directory').then((d) { |
| 119 d.delete().then((ignore) { | 119 d.delete().then((ignore) { |
| 120 setupListerHandlers(d.list()); | 120 setupListerHandlers(d.list()); |
| 121 setupListerHandlers(d.list(recursive: true)); | 121 setupListerHandlers(d.list(recursive: true)); |
| 122 }); | 122 }); |
| 123 }); | 123 }); |
| 124 } | 124 } |
| 125 | 125 |
| 126 static void testListTooLongName() { | 126 static void testListTooLongName() { |
| 127 asyncStart(); |
| 127 Directory.systemTemp.createTemp('dart_directory').then((d) { | 128 Directory.systemTemp.createTemp('dart_directory').then((d) { |
| 128 var errors = 0; | 129 var errors = 0; |
| 129 asyncStart(); | |
| 130 setupListHandlers(Stream<FileSystemEntity> stream) { | 130 setupListHandlers(Stream<FileSystemEntity> stream) { |
| 131 stream.listen( | 131 stream.listen( |
| 132 (_) => Expect.fail("Listing of non-existing directory should fail"), | 132 (_) => Expect.fail("Listing of non-existing directory should fail"), |
| 133 onError: (error) { | 133 onError: (error) { |
| 134 Expect.isTrue(error is FileSystemException); | 134 Expect.isTrue(error is FileSystemException); |
| 135 if (++errors == 2) { | 135 if (++errors == 2) { |
| 136 d.delete(recursive: true).then((_) { | 136 d.delete(recursive: true).then((_) { |
| 137 asyncEnd(); | 137 asyncEnd(); |
| 138 }); | 138 }); |
| 139 } | 139 } |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 DirectoryTest.testMain(); | 617 DirectoryTest.testMain(); |
| 618 NestedTempDirectoryTest.testMain(); | 618 NestedTempDirectoryTest.testMain(); |
| 619 testCreateTempErrorSync(); | 619 testCreateTempErrorSync(); |
| 620 testCreateTempError(); | 620 testCreateTempError(); |
| 621 testCreateExistingSync(); | 621 testCreateExistingSync(); |
| 622 testCreateExisting(); | 622 testCreateExisting(); |
| 623 testCreateDirExistingFileSync(); | 623 testCreateDirExistingFileSync(); |
| 624 testCreateDirExistingFile(); | 624 testCreateDirExistingFile(); |
| 625 testRename(); | 625 testRename(); |
| 626 } | 626 } |
| OLD | NEW |