Bug 1326534 - Rename sessionCapabilities variable for brevity; r=whimboo, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Sat, 31 Dec 2016 12:32:14 +0000
changeset 353422 cba32349dc8429b40a79b413957f2362a865b449
parent 353421 5a5f3d0711d1ae4e1b1cef74447a6aa897c23ee5
child 353423 7ae159c1ae97b5615071331e9a4b8826230dbf2c
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo, test-only
bugs1326534
milestone52.0a2
Bug 1326534 - Rename sessionCapabilities variable for brevity; r=whimboo, a=test-only MozReview-Commit-ID: KGYk2CgwERy
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -132,17 +132,17 @@ this.GeckoDriver = function (appName, se
   this.legacyactions = new legacyaction.Chain();
 
   this.timer = null;
   this.inactivityTimer = null;
 
   this.marionetteLog = new logging.ContentLogger();
   this.testName = null;
 
-  this.sessionCapabilities = new session.Capabilities();
+  this.capabilities = new session.Capabilities();
 
   this.mm = globalMessageManager;
   this.listener = proxy.toListener(() => this.mm, this.sendAsync.bind(this));
 
   // always keep weak reference to current dialogue
   this.dialog = null;
   let handleDialog = (subject, topic) => {
     let winr;
@@ -151,17 +151,17 @@ this.GeckoDriver = function (appName, se
     }
     this.dialog = new modal.Dialog(() => this.curBrowser, winr);
   };
   modal.addHandler(handleDialog);
 };
 
 Object.defineProperty(GeckoDriver.prototype, "a11yChecks", {
   get: function () {
-    return this.sessionCapabilities.get("moz:accessibilityChecks");
+    return this.capabilities.get("moz:accessibilityChecks");
   }
 });
 
 GeckoDriver.prototype.QueryInterface = XPCOMUtils.generateQI([
   Ci.nsIMessageListener,
   Ci.nsIObserver,
   Ci.nsISupportsWeakReference,
 ]);
@@ -432,24 +432,24 @@ GeckoDriver.prototype.registerBrowser = 
   if (mainContent) {
     this.mainContentFrameId = this.curBrowser.curFrameId;
   }
 
   this.wins.set(reg.id, listenerWindow);
   if (nullPrevious && (this.curBrowser.curFrameId !== null)) {
     this.sendAsync(
         "newSession",
-        this.sessionCapabilities.toJSON(),
+        this.capabilities.toJSON(),
         this.newSessionCommandId);
     if (this.curBrowser.isNewSession) {
       this.newSessionCommandId = null;
     }
   }
 
-  return [reg, mainContent, this.sessionCapabilities.toJSON()];
+  return [reg, mainContent, this.capabilities.toJSON()];
 };
 
 GeckoDriver.prototype.registerPromise = function() {
   const li = "Marionette:register";
 
   return new Promise(resolve => {
     let cb = msg => {
       let wid = msg.json.value;
@@ -480,52 +480,52 @@ GeckoDriver.prototype.listeningPromise =
       resolve();
     };
     this.mm.addMessageListener(li, cb);
   });
 };
 
 Object.defineProperty(GeckoDriver.prototype, "timeouts", {
   get: function () {
-    return this.sessionCapabilities.get("timeouts");
+    return this.capabilities.get("timeouts");
   },
 
   set: function (newTimeouts) {
-    this.sessionCapabilities.set("timeouts", newTimeouts);
+    this.capabilities.set("timeouts", newTimeouts);
   },
 });
 
 Object.defineProperty(GeckoDriver.prototype, "secureTLS", {
   get: function () {
-    return !this.sessionCapabilities.get("acceptInsecureCerts");
+    return !this.capabilities.get("acceptInsecureCerts");
   }
 });
 
 Object.defineProperty(GeckoDriver.prototype, "proxy", {
   get: function () {
-    return this.sessionCapabilities.get("proxy");
+    return this.capabilities.get("proxy");
   }
 });
 
 /** Create a new session. */
 GeckoDriver.prototype.newSession = function*(cmd, resp) {
   if (this.sessionId) {
     throw new SessionNotCreatedError("Maximum number of active sessions");
   }
 
   this.sessionId = cmd.parameters.sessionId ||
       cmd.parameters.session_id ||
       element.generateUUID();
   this.newSessionCommandId = cmd.id;
 
   try {
-    this.sessionCapabilities = session.Capabilities.fromJSON(
+    this.capabilities = session.Capabilities.fromJSON(
         cmd.parameters.capabilities, {merge: true});
     logger.config("Matched capabilities: " +
-        JSON.stringify(this.sessionCapabilities));
+        JSON.stringify(this.capabilities));
   } catch (e) {
     throw new SessionNotCreatedError(e);
   }
 
   if (!this.secureTLS) {
     logger.warn("TLS certificate errors will be ignored for this session");
     let acceptAllCerts = new cert.InsecureSweepingOverride();
     cert.installOverride(acceptAllCerts);
@@ -601,33 +601,33 @@ GeckoDriver.prototype.newSession = funct
 
   yield registerBrowsers;
   yield browserListening;
 
   this.curBrowser.browserForTab.focus();
 
   return {
     sessionId: this.sessionId,
-    capabilities: this.sessionCapabilities,
+    capabilities: this.capabilities,
   };
 };
 
 /**
  * Send the current session's capabilities to the client.
  *
  * Capabilities informs the client of which WebDriver features are
  * supported by Firefox and Marionette.  They are immutable for the
  * length of the session.
  *
  * The return value is an immutable map of string keys
  * ("capabilities") to values, which may be of types boolean,
  * numerical or string.
  */
 GeckoDriver.prototype.getSessionCapabilities = function (cmd, resp) {
-  resp.body.capabilities = this.sessionCapabilities;
+  resp.body.capabilities = this.capabilities;
 };
 
 /**
  * Log message.  Accepts user defined log-level.
  *
  * @param {string} value
  *     Log message.
  * @param {string} level
@@ -2219,17 +2219,17 @@ GeckoDriver.prototype.sessionTearDown = 
     }
     this.observing = null;
   }
 
   this.sandboxes.clear();
   cert.uninstallOverride();
 
   this.sessionId = null;
-  this.sessionCapabilities = new session.Capabilities();
+  this.capabilities = new session.Capabilities();
 };
 
 /**
  * Processes the "deleteSession" request from the client by tearing down
  * the session and responding "ok".
  */
 GeckoDriver.prototype.deleteSession = function (cmd, resp) {
   this.sessionTearDown();
@@ -2667,17 +2667,17 @@ GeckoDriver.prototype.receiveMessage = f
       let rv = this.registerBrowser(wid, be);
       return rv;
 
     case "Marionette:listenersAttached":
       if (message.json.listenerId === this.curBrowser.curFrameId) {
         // 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.
-        this.sendAsync("newSession", this.sessionCapabilities);
+        this.sendAsync("newSession", this.capabilities);
         this.curBrowser.flushPendingCommands();
       }
       break;
   }
 };
 
 GeckoDriver.prototype.responseCompleted = function () {
   if (this.curBrowser !== null) {