| Index: tests/standalone/io/platform_test.dart
|
| diff --git a/tests/standalone/io/platform_test.dart b/tests/standalone/io/platform_test.dart
|
| index f07475061da1081074421882db52acabbd972dcf..f50675e360ef6c12a1e6846130b4cbf7fb5bef5e 100644
|
| --- a/tests/standalone/io/platform_test.dart
|
| +++ b/tests/standalone/io/platform_test.dart
|
| @@ -9,7 +9,8 @@ import "dart:isolate";
|
| import "package:async_helper/async_helper.dart";
|
| import "package:expect/expect.dart";
|
|
|
| -test() {
|
| +test() async {
|
| + asyncStart();
|
| Expect.isTrue(Platform.numberOfProcessors > 0);
|
| var os = Platform.operatingSystem;
|
| Expect.isTrue(os == "android" || os == "linux" || os == "macos" ||
|
| @@ -48,17 +49,25 @@ test() {
|
| Expect.isTrue(Platform.script.toFilePath().startsWith(oldDir.path));
|
| // Restore dir.
|
| Directory.current = oldDir;
|
| - Directory packageRoot = new Directory(Platform.packageRoot);
|
| + String platformPackageRoot = (await Platform.packageRoot).toFilePath();
|
| + Directory packageRoot = new Directory(platformPackageRoot);
|
| Expect.isTrue(packageRoot.existsSync());
|
| Expect.isTrue(new Directory("${packageRoot.path}/expect").existsSync());
|
| Expect.isTrue(Platform.executableArguments.any(
|
| - (arg) => arg.contains(Platform.packageRoot)));
|
| + (arg) {
|
| + if (!arg.startsWith("--package-root=")) {
|
| + return false;
|
| + }
|
| + var commandPackageRoot = arg.replaceFirst("--package-root=", "");
|
| + return platformPackageRoot.endsWith(commandPackageRoot);
|
| + }));
|
| + asyncEnd();
|
| }
|
|
|
| -void f(reply) {
|
| +f(reply) async {
|
| reply.send({"Platform.executable": Platform.executable,
|
| "Platform.script": Platform.script,
|
| - "Platform.packageRoot": Platform.packageRoot,
|
| + "Platform.packageRoot": (await Platform.packageRoot).toString(),
|
| "Platform.executableArguments": Platform.executableArguments});
|
| }
|
|
|
| @@ -66,7 +75,7 @@ testIsolate() {
|
| asyncStart();
|
| ReceivePort port = new ReceivePort();
|
| var remote = Isolate.spawn(f, port.sendPort);
|
| - port.first.then((results) {
|
| + port.first.then((results) async {
|
| Expect.equals(Platform.executable, results["Platform.executable"]);
|
|
|
| Uri uri = results["Platform.script"];
|
| @@ -74,7 +83,8 @@ testIsolate() {
|
| // case was a relative path.
|
| Expect.equals("file", uri.scheme);
|
| Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart'));
|
| - Expect.equals(Platform.packageRoot, results["Platform.packageRoot"]);
|
| + var packageRoot = await Platform.packageRoot;
|
| + Expect.equals(packageRoot.toString(), results["Platform.packageRoot"]);
|
| Expect.listEquals(Platform.executableArguments,
|
| results["Platform.executableArguments"]);
|
| asyncEnd();
|
|
|