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

Unified Diff: tests/standalone/io/windows_file_system_links_test.dart

Issue 12691002: dart:io | Add Link class, as sibling to File and Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows errors Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/link_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/windows_file_system_links_test.dart
diff --git a/tests/standalone/io/windows_file_system_links_test.dart b/tests/standalone/io/windows_file_system_links_test.dart
index 2598052dba0540154580a9695cda7ce075659334..b5a6f09238c6d71566866315e7ca708a8ab1c2fc 100644
--- a/tests/standalone/io/windows_file_system_links_test.dart
+++ b/tests/standalone/io/windows_file_system_links_test.dart
@@ -5,24 +5,13 @@
import "dart:io";
import "dart:isolate";
-createJunction(String dst, String link, void callback()) {
- Process.run("cmd.exe", ["/c", "mklink /J $link $dst"]).then((result) {
- if (result.exitCode == 0) {
- callback();
- } else {
- throw new Exception('link creation failed');
- }
- });
-}
-
-
testJunctionTypeDelete() {
var temp = new Directory('').createTempSync();
var x = '${temp.path}${Platform.pathSeparator}x';
var y = '${temp.path}${Platform.pathSeparator}y';
new Directory(x).createSync();
- createJunction(x, y, () {
+ new Link(y).create(x).then((_) {
Expect.isTrue(new Directory(y).existsSync());
Expect.isTrue(new Directory(x).existsSync());
Expect.isTrue(FileSystemEntity.isLinkSync(y));
@@ -37,7 +26,6 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(x, followLinks: false));
-
// Test Junction pointing to a missing directory.
new Directory(x).deleteSync();
Expect.isTrue(new Directory(y).existsSync());
@@ -62,7 +50,7 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(y));
new Directory(x).createSync();
- createJunction(x, y, () {
+ new Link(y).create(x).then((_) {
Expect.equals(FileSystemEntityType.LINK,
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.DIRECTORY,
« no previous file with comments | « tests/standalone/io/link_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698