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

Side by Side Diff: tests/isolate/package_root_test.dart

Issue 1553233002: Add package config support to dart:isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed review comments. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:io';
6 import 'dart:isolate';
7
8 final SPAWN_PACKAGE_ROOT = "file:///no/such/file/";
9
10 void main([args, port]) async {
11 if (port != null) {
12 testPackageRoot(port);
13 return;
14 }
15 var p = new RawReceivePort();
16 Isolate.spawnUri(Platform.script,
17 [],
18 p.sendPort,
19 packageRoot: Uri.parse(SPAWN_PACKAGE_ROOT));
20 p.handler = (msg) {
21 p.close();
22 if (msg != SPAWN_PACKAGE_ROOT) {
23 throw "Bad package root in child isolate: $msg";
24 }
25 print("SUCCESS");
26 };
27 print("Spawning isolate's package root: ${await Isolate.packageRoot}");
28 }
29
30 testPackageRoot(port) async {
31 var packageRoot = await Isolate.packageRoot;
32 print("Spawned isolate's package root: $packageRoot");
33 port.send(packageRoot.toString());
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698