зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1202707: Remove emulator commands from simpletest harness
We attach the emulator commands outside of the simpletest harness. Removing this makes testing/marionette/simpletest.js less dependent on Marionette. r=dburns --HG-- extra : commitid : 8jVQBdufXQg extra : rebase_source : 5ea9660825fd76504d0cc7fdbc1bebba947836f5
This commit is contained in:
Родитель
cc041bab79
Коммит
b62463c664
|
@ -908,7 +908,6 @@ GeckoDriver.prototype.execute = function(cmd, resp, directInject) {
|
|||
!(sandboxName in this.sandboxes) ||
|
||||
(this.sandboxes[sandboxName].proto != win)) {
|
||||
let marionette = new Marionette(
|
||||
this,
|
||||
win,
|
||||
"chrome",
|
||||
this.marionetteLog,
|
||||
|
@ -1112,7 +1111,6 @@ GeckoDriver.prototype.executeWithCallback = function(cmd, resp, directInject) {
|
|||
|
||||
if (newSandbox || !(sandboxName in this.sandboxes)) {
|
||||
let marionette = new Marionette(
|
||||
this,
|
||||
win,
|
||||
"chrome",
|
||||
this.marionetteLog,
|
||||
|
|
|
@ -476,20 +476,16 @@ function checkForInterrupted() {
|
|||
*/
|
||||
function createExecuteContentSandbox(win, timeout) {
|
||||
let mn = new Marionette(
|
||||
this,
|
||||
win,
|
||||
"content",
|
||||
marionetteLogObj,
|
||||
timeout,
|
||||
heartbeatCallback,
|
||||
marionetteTestName);
|
||||
mn.runEmulatorCmd = (cmd, cb) => this.runEmulatorCmd(cmd, cb);
|
||||
mn.runEmulatorShell = (args, cb) => this.runEmulatorShell(args, cb);
|
||||
|
||||
let principal = win;
|
||||
if (sandboxName == 'system') {
|
||||
principal = Cc["@mozilla.org/systemprincipal;1"].
|
||||
createInstance(Ci.nsIPrincipal);
|
||||
if (sandboxName == "system") {
|
||||
principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
|
||||
}
|
||||
let sandbox = new Cu.Sandbox(principal, {sandboxPrototype: win});
|
||||
sandbox.global = sandbox;
|
||||
|
@ -507,6 +503,8 @@ function createExecuteContentSandbox(win, timeout) {
|
|||
sandbox[fn] = mn[fn];
|
||||
}
|
||||
});
|
||||
sandbox.runEmulatorCmd = (cmd, cb) => this.runEmulatorCmd(cmd, cb);
|
||||
sandbox.runEmulatorShell = (args, cb) => this.runEmulatorShell(args, cb);
|
||||
|
||||
sandbox.asyncComplete = (obj, id) => {
|
||||
if (id == asyncTestCommandId) {
|
||||
|
|
|
@ -11,9 +11,8 @@ this.EXPORTED_SYMBOLS = ["Marionette"];
|
|||
/*
|
||||
* The Marionette object, passed to the script context.
|
||||
*/
|
||||
this.Marionette = function(scope, window, context, logObj, timeout,
|
||||
this.Marionette = function(window, context, logObj, timeout,
|
||||
heartbeatCallback, testName) {
|
||||
this.scope = scope;
|
||||
this.window = window;
|
||||
this.tests = [];
|
||||
this.logObj = logObj;
|
||||
|
@ -37,8 +36,6 @@ Marionette.prototype = {
|
|||
"getLogs",
|
||||
"generate_results",
|
||||
"waitFor",
|
||||
"runEmulatorCmd",
|
||||
"runEmulatorShell",
|
||||
"TEST_PASS",
|
||||
"TEST_KNOWN_FAIL",
|
||||
"TEST_UNEXPECTED_FAIL",
|
||||
|
@ -46,7 +43,6 @@ Marionette.prototype = {
|
|||
],
|
||||
|
||||
addTest: function Marionette__addTest(condition, name, passString, failString, diag, state) {
|
||||
|
||||
let test = {'result': !!condition, 'name': name, 'diag': diag, 'state': state};
|
||||
this.logResult(test,
|
||||
typeof(passString) == "undefined" ? this.TEST_PASS : passString,
|
||||
|
@ -203,14 +199,4 @@ Marionette.prototype = {
|
|||
}
|
||||
this.window.setTimeout(this.waitFor.bind(this), 100, callback, test, deadline);
|
||||
},
|
||||
|
||||
runEmulatorCmd: function runEmulatorCmd(cmd, callback) {
|
||||
this.heartbeatCallback();
|
||||
this.scope.runEmulatorCmd(cmd, callback);
|
||||
},
|
||||
|
||||
runEmulatorShell: function runEmulatorShell(args, callback) {
|
||||
this.heartbeatCallback();
|
||||
this.scope.runEmulatorShell(args, callback);
|
||||
},
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче