Bug 1245064 - Pass all capabilities to listener; r=automatedtester a=test-only

MozReview-Commit-ID: 2UgKKAUowM4
This commit is contained in:
Andreas Tolfsen 2016-03-04 18:02:56 +00:00
parent b31f62a5fb
commit e262a84132
2 changed files with 5 additions and 15 deletions

View File

@ -451,19 +451,14 @@ GeckoDriver.prototype.registerBrowser = function(id, be) {
this.curBrowser.elementManager.seenItems[reg.id] =
Cu.getWeakReference(listenerWindow);
let flags = {
B2G: (this.appName == "B2G"),
raisesAccessibilityExceptions:
this.sessionCapabilities.raisesAccessibilityExceptions
};
if (nullPrevious && (this.curBrowser.curFrameId !== null)) {
this.sendAsync("newSession", flags, this.newSessionCommandId);
this.sendAsync("newSession", this.sessionCapabilities, this.newSessionCommandId);
if (this.curBrowser.isNewSession) {
this.newSessionCommandId = null;
}
}
return [reg, mainContent, flags];
return [reg, mainContent, this.sessionCapabilities];
};
GeckoDriver.prototype.registerPromise = function() {
@ -2898,12 +2893,7 @@ GeckoDriver.prototype.receiveMessage = function(message) {
// If remoteness gets updated we need to call newSession. In the case
// of desktop this just sets up a small amount of state that doesn't
// change over the course of a session.
let newSessionValues = {
B2G: (this.appName == "B2G"),
raisesAccessibilityExceptions:
this.sessionCapabilities.raisesAccessibilityExceptions
};
this.sendAsync("newSession", newSessionValues);
this.sendAsync("newSession", this.sessionCapabilities);
this.curBrowser.flushPendingCommands();
}
break;

View File

@ -109,7 +109,7 @@ function registerSelf() {
if (register[0]) {
let {id, remotenessChange} = register[0][0];
capabilities = register[0][2];
isB2G = capabilities.B2G;
isB2G = capabilities.platformName == "B2G";
listenerId = id;
if (typeof id != "undefined") {
// check if we're the main process
@ -300,7 +300,7 @@ function waitForReady() {
*/
function newSession(msg) {
capabilities = msg.json;
isB2G = capabilities.B2G;
isB2G = capabilities.platformName == "B2G";
resetValues();
if (isB2G) {
readyStateTimer.initWithCallback(waitForReady, 100, Ci.nsITimer.TYPE_ONE_SHOT);