| 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 import "dart:async"; | 5 import "dart:async"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:isolate"; | 7 import "dart:isolate"; |
| 8 | 8 |
| 9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 var hostname = Platform.localHostname; | 23 var hostname = Platform.localHostname; |
| 24 Expect.isTrue(hostname is String && hostname != ""); | 24 Expect.isTrue(hostname is String && hostname != ""); |
| 25 var environment = Platform.environment; | 25 var environment = Platform.environment; |
| 26 Expect.isTrue(environment is Map<String, String>); | 26 Expect.isTrue(environment is Map<String, String>); |
| 27 Expect.isTrue(Platform.executable.contains('dart')); | 27 Expect.isTrue(Platform.executable.contains('dart')); |
| 28 // Move directory to be sure script is correct. | 28 // Move directory to be sure script is correct. |
| 29 var oldDir = Directory.current; | 29 var oldDir = Directory.current; |
| 30 Directory.current = Directory.current.parent; | 30 Directory.current = Directory.current.parent; |
| 31 Expect.isTrue(Platform.script.path. | 31 Expect.isTrue(Platform.script.path. |
| 32 endsWith('tests/standalone/io/platform_test.dart')); | 32 endsWith('tests/standalone/io/platform_test.dart')); |
| 33 Expect.isTrue(Platform.script.path.startsWith(oldDir.path)); | 33 Expect.isTrue(Platform.script.toFilePath().startsWith(oldDir.path)); |
| 34 // Restore dir. | 34 // Restore dir. |
| 35 Directory.current = oldDir; | 35 Directory.current = oldDir; |
| 36 Directory packageRoot = new Directory(Platform.packageRoot); | 36 Directory packageRoot = new Directory(Platform.packageRoot); |
| 37 Expect.isTrue(packageRoot.existsSync()); | 37 Expect.isTrue(packageRoot.existsSync()); |
| 38 Expect.isTrue(new Directory("${packageRoot.path}/expect").existsSync()); | 38 Expect.isTrue(new Directory("${packageRoot.path}/expect").existsSync()); |
| 39 Expect.isTrue(Platform.executableArguments.any( | 39 Expect.isTrue(Platform.executableArguments.any( |
| 40 (arg) => arg.contains(Platform.packageRoot))); | 40 (arg) => arg.contains(Platform.packageRoot))); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void f(reply) { | 43 void f(reply) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 63 Expect.listEquals(Platform.executableArguments, | 63 Expect.listEquals(Platform.executableArguments, |
| 64 results["Platform.executableArguments"]); | 64 results["Platform.executableArguments"]); |
| 65 asyncEnd(); | 65 asyncEnd(); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 main() { | 69 main() { |
| 70 test(); | 70 test(); |
| 71 testIsolate(); | 71 testIsolate(); |
| 72 } | 72 } |
| OLD | NEW |