| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 testIsolate() { | 58 testIsolate() { |
| 59 asyncStart(); | 59 asyncStart(); |
| 60 var sendPort = spawnFunction(f); | 60 var sendPort = spawnFunction(f); |
| 61 Future.wait([sendPort.call("Platform.executable"), | 61 Future.wait([sendPort.call("Platform.executable"), |
| 62 sendPort.call("Platform.script"), | 62 sendPort.call("Platform.script"), |
| 63 sendPort.call("Platform.packageRoot"), | 63 sendPort.call("Platform.packageRoot"), |
| 64 sendPort.call("Platform.executableArguments")]) | 64 sendPort.call("Platform.executableArguments")]) |
| 65 .then((results) { | 65 .then((results) { |
| 66 Expect.equals(Platform.executable, results[0]); | 66 Expect.equals(Platform.executable, results[0]); |
| 67 Uri uri = Uri.parse(results[1]); | 67 Uri uri = Uri.parse(results[1]); |
| 68 Expect.equals("file", uri.scheme); | 68 // SpawnFunction retains the script url of the parent which in this |
| 69 // case was a relative path. |
| 70 Expect.equals("", uri.scheme); |
| 69 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart')); | 71 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart')); |
| 70 Expect.equals(Platform.packageRoot, results[2]); | 72 Expect.equals(Platform.packageRoot, results[2]); |
| 71 Expect.listEquals(Platform.executableArguments, results[3]); | 73 Expect.listEquals(Platform.executableArguments, results[3]); |
| 72 sendPort.call("close").then((_) => asyncEnd()); | 74 sendPort.call("close").then((_) => asyncEnd()); |
| 73 }); | 75 }); |
| 74 } | 76 } |
| 75 | 77 |
| 76 main() { | 78 main() { |
| 77 test(); | 79 test(); |
| 78 testIsolate(); | 80 testIsolate(); |
| 79 } | 81 } |
| OLD | NEW |