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

Unified Diff: sdk/lib/_internal/pub_generated/test/test_pub.dart

Issue 586173002: Make binstubs run snapshots directly when possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise! Created 6 years, 3 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
Index: sdk/lib/_internal/pub_generated/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub_generated/test/test_pub.dart b/sdk/lib/_internal/pub_generated/test/test_pub.dart
index d849b823645df59567f0d2a5b5099af6b12abf35..c16e146273f6b110d824e8bc6f5c1292d9a86304 100644
--- a/sdk/lib/_internal/pub_generated/test/test_pub.dart
+++ b/sdk/lib/_internal/pub_generated/test/test_pub.dart
@@ -280,11 +280,21 @@ void confirmPublish(ScheduledProcess pub) {
"Looks great! Are you ready to upload your package (y/n)?"));
pub.writeLine("y");
}
-ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
- String pathInSandbox(String relPath) {
- return p.join(p.absolute(sandboxDir), relPath);
+String _pathInSandbox(String relPath) {
+ return p.join(p.absolute(sandboxDir), relPath);
+}
+Map getPubTestEnvironment([Uri tokenEndpoint]) {
+ var environment = {};
+ environment['_PUB_TESTING'] = 'true';
+ environment['PUB_CACHE'] = _pathInSandbox(cachePath);
+ environment['_PUB_TEST_SDK_VERSION'] = "0.1.2+3";
+ if (tokenEndpoint != null) {
+ environment['_PUB_TEST_TOKEN_ENDPOINT'] = tokenEndpoint.toString();
}
- ensureDir(pathInSandbox(appPath));
+ return environment;
+}
+ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
+ ensureDir(_pathInSandbox(appPath));
var dartBin = Platform.executable;
if (dartBin.contains(Platform.pathSeparator)) {
dartBin = p.absolute(dartBin);
@@ -294,13 +304,7 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
dartArgs.addAll(args);
if (tokenEndpoint == null) tokenEndpoint = new Future.value();
var environmentFuture = tokenEndpoint.then((tokenEndpoint) {
- var environment = {};
- environment['_PUB_TESTING'] = 'true';
- environment['PUB_CACHE'] = pathInSandbox(cachePath);
- environment['_PUB_TEST_SDK_VERSION'] = "0.1.2+3";
- if (tokenEndpoint != null) {
- environment['_PUB_TEST_TOKEN_ENDPOINT'] = tokenEndpoint.toString();
- }
+ var environment = getPubTestEnvironment(tokenEndpoint);
if (_hasServer) {
return port.then((p) {
environment['PUB_HOSTED_URL'] = "http://localhost:$p";
@@ -313,7 +317,7 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
dartBin,
dartArgs,
environment: environmentFuture,
- workingDirectory: pathInSandbox(appPath),
+ workingDirectory: _pathInSandbox(appPath),
description: args.isEmpty ? 'pub' : 'pub ${args.first}');
}
class PubProcess extends ScheduledProcess {

Powered by Google App Engine
This is Rietveld 408576698