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

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

Issue 22999033: Add Platform.packageRoot and Platform.executableArguments to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve doc comments. Created 7 years, 4 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 | « sdk/lib/io/platform_impl.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/platform_test.dart
diff --git a/tests/standalone/io/platform_test.dart b/tests/standalone/io/platform_test.dart
index 1677e67ab34cd2f89987b48d31694b396accc00c..1fdad2ba292a149c1ce50e98c01f573b3e6f274e 100644
--- a/tests/standalone/io/platform_test.dart
+++ b/tests/standalone/io/platform_test.dart
@@ -25,6 +25,11 @@ test() {
Expect.isTrue(Platform.executable.contains('dart'));
Expect.isTrue(Platform.script.replaceAll('\\', '/').
endsWith('tests/standalone/io/platform_test.dart'));
+ Directory packageRoot = new Directory(Platform.packageRoot);
+ Expect.isTrue(packageRoot.existsSync());
+ Expect.isTrue(new Directory("${packageRoot.path}/expect").existsSync());
+ Expect.isTrue(Platform.executableArguments.any(
+ (arg) => arg.contains(Platform.packageRoot)));
}
void f() {
@@ -35,6 +40,12 @@ void f() {
if (msg == "Platform.script") {
reply.send(Platform.script);
}
+ if (msg == "Platform.packageRoot") {
+ reply.send(Platform.packageRoot);
+ }
+ if (msg == "Platform.executableArguments") {
+ reply.send(Platform.executableArguments);
+ }
if (msg == "new Options().executable") {
reply.send(new Options().executable);
}
@@ -53,15 +64,19 @@ testIsolate() {
var sendPort = spawnFunction(f);
Future.wait([sendPort.call("Platform.executable"),
sendPort.call("Platform.script"),
+ sendPort.call("Platform.packageRoot"),
+ sendPort.call("Platform.executableArguments"),
sendPort.call("new Options().executable"),
sendPort.call("new Options().script")])
.then((results) {
Expect.equals(Platform.executable, results[0]);
- Expect.equals(Platform.executable, results[2]);
+ Expect.equals(Platform.executable, results[4]);
Uri uri = Uri.parse(results[1]);
- Expect.equals(uri, Uri.parse(results[3]));
+ Expect.equals(uri, Uri.parse(results[5]));
Expect.equals("file", uri.scheme);
Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart'));
+ Expect.equals(Platform.packageRoot, results[2]);
+ Expect.listEquals(Platform.executableArguments, results[3]);
sendPort.call("close").then((_) => port.close());
});
}
« no previous file with comments | « sdk/lib/io/platform_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698