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

Unified Diff: ports/devenv/tests/common.js

Issue 1563073002: Re-enable io2014 + add cds2014 tests for devenv. (Closed) Base URL: https://chromium.googlesource.com/webports.git@master
Patch Set: fix Created 4 years, 9 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 | « ports/devenv/io2014_test.py ('k') | ports/devenv/tests/demo2014_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ports/devenv/tests/common.js
diff --git a/ports/devenv/tests/common.js b/ports/devenv/tests/common.js
index e2cf7dad52b9e3bfcac25d82d6ae57cc3d8978e9..cd76dbbd74141269b958109e54eeed1a36804f8d 100644
--- a/ports/devenv/tests/common.js
+++ b/ports/devenv/tests/common.js
@@ -40,7 +40,7 @@ DevEnvTest.prototype.setUp = function() {
}).then(function() {
return self.mkdir('/home/user');
}).then(function() {
- return self.checkCommand('bash -c exit 0', 0);
+ return self.checkCommand('bash -c exit', 0);
}).then(function() {
if (self.params['latest'] === '1')
return self.setLocalRepo(window.location.origin);
@@ -87,10 +87,14 @@ DevEnvTest.prototype.gatherStdoutUntil = function(name) {
});
};
-DevEnvTest.prototype.spawnCommand = function(cmd) {
+DevEnvTest.prototype.spawnCommand = function(cmd, env) {
var self = this;
- var env = ['HOME=/home/user', 'NACL_DATA_MOUNT_FLAGS=manifest=/manifest.txt'];
+ if (env === undefined) {
+ env = [];
+ }
+ env.push('HOME=/home/user');
+ env.push('NACL_DATA_MOUNT_FLAGS=manifest=/manifest.txt');
if (this.params['latest'] === '1') {
env.push('NACL_DEVENV_LOCAL=1');
}
@@ -126,12 +130,12 @@ DevEnvTest.prototype.waitCommand = function(pid) {
});
};
-DevEnvTest.prototype.runCommand = function(cmd) {
+DevEnvTest.prototype.runCommand = function(cmd, env) {
var self = this;
var earlyOutput;
chrometest.info('runCommand: ' + cmd);
return Promise.resolve().then(function() {
- return self.spawnCommand(cmd);
+ return self.spawnCommand(cmd, env);
}).then(function(msg) {
earlyOutput = msg.output;
return self.waitCommand(msg.pid);
@@ -142,13 +146,13 @@ DevEnvTest.prototype.runCommand = function(cmd) {
};
DevEnvTest.prototype.checkCommand = function(
- cmd, expectedStatus, expectedOutput) {
+ cmd, expectedStatus, expectedOutput, env) {
if (expectedStatus === undefined) {
expectedStatus = 0;
}
var self = this;
return Promise.resolve().then(function() {
- return self.runCommand(cmd);
+ return self.runCommand(cmd, env);
}).then(function(result) {
ASSERT_EQ(expectedStatus, result.status, result.output);
if (expectedOutput !== undefined) {
@@ -170,12 +174,11 @@ DevEnvTest.prototype.installPackage = function(name) {
};
DevEnvTest.prototype.installDefaultPackages = function(name) {
- var cmd = 'bash /mnt/http/install-base-packages.sh';
- chrometest.info(cmd);
- return this.checkCommand(cmd, 0);
+ var env = ['INSTALL_BASE_PACKAGES=1'];
+ chrometest.info('install base packages');
+ return this.checkCommand('exit', 0, undefined, env);
};
-
DevEnvTest.prototype.checkCommandReLines = function(
cmd, expectedStatus, expectedOutput) {
var self = this;
« no previous file with comments | « ports/devenv/io2014_test.py ('k') | ports/devenv/tests/demo2014_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698