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

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

Issue 25471003: Modify tests to use Directory.systemTemp (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase 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
OLDNEW
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 // Directory listing test. 5 // Directory listing test.
6 6
7 7
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";
11 import "package:expect/expect.dart"; 11 import "package:expect/expect.dart";
12 12
13 testChangeDirectory() { 13 testChangeDirectory() {
14 asyncStart(); 14 asyncStart();
15 new Directory("").createTemp().then((temp) { 15 Directory.systemTemp.createTemp('dart_directory_chdir').then((temp) {
16 var initialCurrent = Directory.current; 16 var initialCurrent = Directory.current;
17 Directory.current = temp; 17 Directory.current = temp;
18 var newCurrent = Directory.current; 18 var newCurrent = Directory.current;
19 new File("111").createSync(); 19 new File("111").createSync();
20 var dir = new Directory(newCurrent.path + Platform.pathSeparator + "222"); 20 var dir = new Directory(newCurrent.path + Platform.pathSeparator + "222");
21 dir.createSync(); 21 dir.createSync();
22 Directory.current = dir; 22 Directory.current = dir;
23 new File("333").createSync(); 23 new File("333").createSync();
24 Expect.isTrue(new File("333").existsSync()); 24 Expect.isTrue(new File("333").existsSync());
25 Expect.isTrue(new File("../111").existsSync()); 25 Expect.isTrue(new File("../111").existsSync());
(...skipping 22 matching lines...) Expand all
48 Expect.throws(() => Directory.current = [], (e) => e is ArgumentError); 48 Expect.throws(() => Directory.current = [], (e) => e is ArgumentError);
49 Expect.throws(() => Directory.current = new File("xxx"), 49 Expect.throws(() => Directory.current = new File("xxx"),
50 (e) => e is ArgumentError); 50 (e) => e is ArgumentError);
51 } 51 }
52 52
53 53
54 main() { 54 main() {
55 testChangeDirectory(); 55 testChangeDirectory();
56 testChangeDirectoryIllegalArguments(); 56 testChangeDirectoryIllegalArguments();
57 } 57 }
OLDNEW
« no previous file with comments | « tests/standalone/io/delete_symlink_test.dart ('k') | tests/standalone/io/directory_create_race_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698