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

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

Issue 1307183002: Add access to the isolate package-root/package-map in Platform. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: replace packageRoot getter, remove C++ imp. Created 5 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 f07475061da1081074421882db52acabbd972dcf..65b6226ce9e091f0ea55148ff6972409e9e6eac1 100644
--- a/tests/standalone/io/platform_test.dart
+++ b/tests/standalone/io/platform_test.dart
@@ -48,11 +48,20 @@ test() {
Expect.isTrue(Platform.script.toFilePath().startsWith(oldDir.path));
// Restore dir.
Directory.current = oldDir;
- 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)));
+ Uri packageRoot = Platform.packageRoot;
+ Map packageMap = Platform.packageMap;
+ // One of packageRoot or packageMap is non-null.
+ Expect.isTrue((packageRoot == null) != (packageMap == null));
+ if (packageRoot != null) {
+ Directory packageDir = new Directory.fromUri(packageRoot);
+ Expect.isTrue(packageRoot.existsSync());
+ Expect.isTrue(new Directory("${packageRoot.path}/expect").existsSync());
+ } else {
+ Uri expectUri = packageMap["expect"];
+ Expect.isNotNull(expectUri);
+ Directory expectDir = new Directory.fromUri(expectUri);
+ Expect.isTrue(expectDir.existsSync());
+ }
}
void f(reply) {
« 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