Bug 1336124 - Remove unused B2G code in session teardown; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 16:10:18 +0000
changeset 479424 81bb572d22573c7b57eb1480a0d25d503645f406
parent 479423 6822f0035a004c0f5871880e1bc5addb3edc6040
child 479425 9161dbf2f4776e3d2730ef4bf2202cf68648ade9
push id44249
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 16:53:35 +0000
reviewersmaja_zf
bugs1336124
milestone54.0a1
Bug 1336124 - Remove unused B2G code in session teardown; r?maja_zf MozReview-Commit-ID: CHmdB7BvBT8
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2174,39 +2174,32 @@ GeckoDriver.prototype.closeChromeWindow 
  *
  * 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) {
   if (this.curBrowser !== null) {
-    if (this.appName == "B2G") {
-      globalMessageManager.broadcastAsyncMessage(
-          "Marionette:sleepSession" + this.curBrowser.mainContentId, {});
-      this.curBrowser.knownFrames.splice(
-          this.curBrowser.knownFrames.indexOf(this.curBrowser.mainContentId), 1);
-    } else {
-      // don't set this pref for B2G since the framescript can be safely reused
-      Preferences.set(CONTENT_LISTENER_PREF, false);
-    }
+    // 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) {
         globalMessageManager.broadcastAsyncMessage(
             "Marionette:deleteSession" + browser.knownFrames[i], {});
       }
     }
 
     let winEn = Services.wm.getEnumerator(null);
     while (winEn.hasMoreElements()) {
       let win = winEn.getNext();
-      if (win.messageManager){
+      if (win.messageManager) {
         win.messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
       } else {
         logger.error(
             `Could not remove listener from page ${win.location.href}`);
       }
     }
 
     this.curBrowser.frameManager.removeMessageManagerListeners(