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

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

Issue 25279003: dart:io | Add Directory.CreateSystemTemp(template) and change Directory.CreateTemp(template). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add check of "TMP" environment variable if "TMPDIR" is missing. 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 | « sdk/lib/io/io_service.dart ('k') | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io_service.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698