Bug 1336124 - Rename sessionTeardown to deleteSession; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 16:11:08 +0000
changeset 479425 9161dbf2f4776e3d2730ef4bf2202cf68648ade9
parent 479424 81bb572d22573c7b57eb1480a0d25d503645f406
child 479426 7cd926394e4f9c5043edf8a843afbd3af6dbab4c
push id44249
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 16:53:35 +0000
reviewersmaja_zf
bugs1336124
milestone54.0a1
Bug 1336124 - Rename sessionTeardown to deleteSession; r?maja_zf MozReview-Commit-ID: F1jPkzL3zwU
testing/marionette/dispatcher.js
testing/marionette/driver.js
--- a/testing/marionette/dispatcher.js
+++ b/testing/marionette/dispatcher.js
@@ -51,17 +51,17 @@ this.Dispatcher = function (connId, tran
   this.commands_ = new Map();
 };
 
 /**
  * Debugger transport callback that cleans up
  * after a connection is closed.
  */
 Dispatcher.prototype.onClosed = function (reason) {
-  this.driver.sessionTearDown();
+  this.driver.deleteSession();
   if (this.onclose) {
     this.onclose(this);
   }
 };
 
 /**
  * Callback that receives data packets from the client.
  *
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2162,27 +2162,18 @@ GeckoDriver.prototype.closeChromeWindow 
 
   if (this.mm != globalMessageManager) {
     this.mm.removeDelayedFrameScript(FRAME_SCRIPT);
   }
 
   return this.curBrowser.closeWindow().then(() => this.chromeWindowHandles);
 };
 
-/**
- * Deletes the session.
- *
- * If it is a desktop environment, it will close all listeners.
- *
- * If it is a B2G environment, it will make the main content listener
- * sleep, and close all other listeners.  The main content listener
- * persists after disconnect (it's the homescreen), and can safely
- * be reused.
- */
-GeckoDriver.prototype.sessionTearDown = function (cmd, resp) {
+/** Delete Marionette session. */
+GeckoDriver.prototype.deleteSession = function (cmd, resp) {
   if (this.curBrowser !== null) {
     // frame scripts can be safely reused
     Preferences.set(CONTENT_LISTENER_PREF, false);
 
     // delete session in each frame in each browser
     for (let win in this.browsers) {
       let browser = this.browsers[win];
       for (let i in browser.knownFrames) {
@@ -2227,24 +2218,16 @@ GeckoDriver.prototype.sessionTearDown = 
 
   this.sandboxes.clear();
   cert.uninstallOverride();
 
   this.sessionId = null;
   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();
-};
-
 /** Returns the current status of the Application Cache. */
 GeckoDriver.prototype.getAppCacheStatus = function* (cmd, resp) {
   switch (this.context) {
     case Context.CHROME:
       throw new UnsupportedOperationError(
           "Command 'getAppCacheStatus' is not yet available in chrome context");
 
     case Context.CONTENT:
@@ -2543,17 +2526,17 @@ GeckoDriver.prototype.quitApplication = 
   let flags = Ci.nsIAppStartup.eAttemptQuit;
   for (let k of cmd.parameters.flags || []) {
     flags |= Ci.nsIAppStartup[k];
   }
 
   this._server.acceptConnections = false;
   resp.send();
 
-  this.sessionTearDown();
+  this.deleteSession();
   Services.startup.quit(flags);
 };
 
 GeckoDriver.prototype.installAddon = function (cmd, resp) {
   assert.firefox()
 
   let path = cmd.parameters.path;
   let temp = cmd.parameters.temporary || false;