| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 : createdDirectories = new List<Directory>() { | 445 : createdDirectories = new List<Directory>() { |
| 446 new Directory("").createTemp().then(createPhaseCallback); | 446 new Directory("").createTemp().then(createPhaseCallback); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void createPhaseCallback(temp) { | 449 void createPhaseCallback(temp) { |
| 450 createdDirectories.add(temp); | 450 createdDirectories.add(temp); |
| 451 int nestingDepth = 6; | 451 int nestingDepth = 6; |
| 452 var os = Platform.operatingSystem; | 452 var os = Platform.operatingSystem; |
| 453 if (os == "windows") nestingDepth = 2; | 453 if (os == "windows") nestingDepth = 2; |
| 454 if (createdDirectories.length < nestingDepth) { | 454 if (createdDirectories.length < nestingDepth) { |
| 455 temp = new Directory( | 455 temp.createTemp('nested_temp_dir_${createdDirectories.length}_') |
| 456 '${temp.path}/nested_temp_dir_${createdDirectories.length}_'); | 456 .then(createPhaseCallback); |
| 457 temp.createTemp().then(createPhaseCallback); | |
| 458 } else { | 457 } else { |
| 459 deletePhaseCallback(); | 458 deletePhaseCallback(); |
| 460 } | 459 } |
| 461 } | 460 } |
| 462 | 461 |
| 463 void deletePhaseCallback() { | 462 void deletePhaseCallback() { |
| 464 if (!createdDirectories.isEmpty) { | 463 if (!createdDirectories.isEmpty) { |
| 465 current = createdDirectories.removeLast(); | 464 current = createdDirectories.removeLast(); |
| 466 current.deleteSync(); | 465 current.deleteSync(); |
| 467 deletePhaseCallback(); | 466 deletePhaseCallback(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 testCreateTempErrorSync(); | 633 testCreateTempErrorSync(); |
| 635 testCreateTempError(); | 634 testCreateTempError(); |
| 636 testCreateExistingSync(); | 635 testCreateExistingSync(); |
| 637 testCreateExisting(); | 636 testCreateExisting(); |
| 638 testCreateDirExistingFileSync(); | 637 testCreateDirExistingFileSync(); |
| 639 testCreateDirExistingFile(); | 638 testCreateDirExistingFile(); |
| 640 testCreateRecursive(); | 639 testCreateRecursive(); |
| 641 testCreateRecursiveSync(); | 640 testCreateRecursiveSync(); |
| 642 testRename(); | 641 testRename(); |
| 643 } | 642 } |
| OLD | NEW |