Bug 1336124 - Rename sessionTeardown to deleteSession; r?maja_zf
MozReview-Commit-ID: F1jPkzL3zwU
--- 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;