Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Commit

Permalink
Bug 617768 - Switch from IPC-Pipe back to nsIProcess. r=atrain
Browse files Browse the repository at this point in the history
  • Loading branch information
whimboo committed Dec 12, 2010
1 parent 4e91a65 commit b98fe5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 47 deletions.
4 changes: 0 additions & 4 deletions extension/chrome.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ resource mozmill-crowd resource/
skin mozmill-crowd classic/1.0 chrome/skin/

overlay chrome://browser/content/browser.xul chrome://mozmill-crowd/content/browser-overlay.xul

interfaces components/ipc.xpt
binary-component components/darwin_x86/libipc.dylib ABI=Darwin_x86-gcc3
binary-component components/darwin_x86_64/libipc.dylib ABI=Darwin_x86_64-gcc3
2 changes: 1 addition & 1 deletion extension/chrome/content/mozmill-crowd.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ var gMozmillCrowd = {
//gMozmillCrowd._execButton.label = this._stringBundle.getString("stopTestrun.label");

this._environment.prepare();
this._environment.execute("start.sh",
this._environment.execute("start.cmd",
this._applications.selectedItem.value,
this._testruns.selectedItem.value);
}
Expand Down
47 changes: 12 additions & 35 deletions extension/chrome/content/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@
*
* ***** END LICENSE BLOCK ***** */

Components.utils.import('resource://mozmill-crowd/subprocess.jsm');

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;


const INTERNAL_NAME = "mozmill-crowd";
const FOLDER_NAME = "crowd";
const ID = "mozmill-crowd@qa.mozilla.org"
const VERSION = "0.1pre";

Expand Down Expand Up @@ -183,7 +181,6 @@ function Environment(aDir) {
getService(Ci.nsIProperties);

this._dir = aDir || this.getDefaultDir();
this._process = null;
}

Environment.prototype = {
Expand Down Expand Up @@ -221,12 +218,11 @@ Environment.prototype = {
*/
execute: function Environment_execute(aScript, aApplication, aTestrun) {
var script = null;

if (this._process)
throw new Exception("There is already a running process. Wait until it has been finished.");
var process = null;

if (aScript != "") {
var script = this.dir.clone();
script.append("mozmill-env");
script.append(aScript);
}
else {
Expand All @@ -237,11 +233,10 @@ Environment.prototype = {
testrun_script.append("mozmill-automation");
testrun_script.append(aTestrun);

var repository = this.dir.clone();
repository.append("mozmill-tests");
var repository = getPref("extensions.mozmill-crowd.repositories.mozmill-tests", "");

var args = [script.path, this.dir.path, testrun_script.path,
"--repository=" + repository.path];
var args = ["python", testrun_script.path,
"--repository=" + repository];

/// XXX: Bit hacky at the moment
if (aTestrun == "testrun_addons.py") {
Expand All @@ -258,37 +253,19 @@ Environment.prototype = {

args = args.concat(aApplication.bundle)

var self = this;
this._process = subprocess.call({
command: "/bin/bash",
arguments: args,
workdir: this.dir,
stdout: subprocess.ReadablePipe(function(data) {
var listbox = gMozmillCrowd._output;
listbox.appendItem(data, null);
listbox.ensureIndexIsVisible(listbox.itemCount - 1);
}),
stderr: subprocess.ReadablePipe(function(data) {
var listbox = gMozmillCrowd._output;
listbox.appendItem(data, null);
listbox.ensureIndexIsVisible(listbox.itemCount - 1);
}),
onFinished: subprocess.Terminate(function() {
var listbox = gMozmillCrowd._output;
listbox.appendItem(data, null);
listbox.ensureIndexIsVisible(listbox.itemCount - 1);

self._process = null;
})
});
// TODO: Has to be a non-blocking process
process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(script);
process.run(true, args, args.length);
},

/**
*
*/
getDefaultDir: function Environment_getDefaultDir() {
var dir = this._dirSrv.get("ProfD", Ci.nsIFile);
dir.append(INTERNAL_NAME);
dir.append(FOLDER_NAME);

return dir;
},
Expand Down
9 changes: 2 additions & 7 deletions extension/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,15 @@
<em:description>Mozmill tests executed from the crowd</em:description>
<em:aboutURL>chrome://mozmill-crowd/content/about.xul</em:aboutURL>
<em:optionsURL>chrome://mozmill-crowd/content/preferences.xul</em:optionsURL>
<em:unpack>true</em:unpack>

<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0b2</em:minVersion>
<em:minVersion>3.5</em:minVersion>
<em:maxVersion>4.0</em:maxVersion>
</Description>
</em:targetApplication>

<em:targetPlatform>Darwin_x86-gcc3</em:targetPlatform>
<em:targetPlatform>Darwin_x86_64-gcc3</em:targetPlatform>

<em:unpack>true</em:unpack>
</Description>

</RDF>

0 comments on commit b98fe5c

Please sign in to comment.