Bug 1336124 - Rename sessionTeardown to deleteSession. r=maja_zf, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 16:11:08 +0000
changeset 366921 246c07f0bf7db1459a159cf57b32cff385147c16
parent 366920 df9b8deb4594bc23788266f19847d11faaf8f3d8
child 366922 4333619aa67d4e00b79b4368a9ac7b149d951fb3
push id6891
push userryanvm@gmail.com
push dateTue, 07 Feb 2017 17:32:45 +0000
treeherdermozilla-beta@be5204c4c3ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1336124
milestone52.0
Bug 1336124 - Rename sessionTeardown to deleteSession. r=maja_zf, a=test-only 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
@@ -2158,27 +2158,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) {
@@ -2223,24 +2214,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:
@@ -2539,17 +2522,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;