Bug 1326534 - Reset session capabilities state on teardown; r?whimboo draft
authorAndreas Tolfsen <ato@mozilla.com>
Sat, 31 Dec 2016 12:28:19 +0000
changeset 457112 6c6c9d713b6bbc60aa7ab498f92a1f88b691f252
parent 457111 0ab1430892e3fa4fbca53bf5b1cd65e88f481e1a
child 457113 e20cb12a7ac34fd98855ad71eae78d0919a249d6
push id40670
push userbmo:ato@mozilla.com
push dateFri, 06 Jan 2017 18:52:13 +0000
reviewerswhimboo
bugs1326534
milestone53.0a1
Bug 1326534 - Reset session capabilities state on teardown; r?whimboo This change resets the session ID after all other state has been cleared, and also reinitialises `GeckoDriver#sessionCapabilities`, which was not done before. MozReview-Commit-ID: Jb40CXuX8h1
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2216,27 +2216,28 @@ GeckoDriver.prototype.sessionTearDown = 
   if (this.mainFrame) {
     try {
       this.mainFrame.focus();
     } catch (e) {
       this.mainFrame = null;
     }
   }
 
-  this.sessionId = null;
-
   if (this.observing !== null) {
     for (let topic in this.observing) {
       Services.obs.removeObserver(this.observing[topic], topic);
     }
     this.observing = null;
   }
 
   this.sandboxes.clear();
   cert.uninstallOverride();
+
+  this.sessionId = null;
+  this.sessionCapabilities = 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();