Bug 1336124 - Remove unused B2G code in session teardown; r=maja_zf
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 16:10:18 +0000
changeset 340936 c93a410adde07a4393778b1cbec7257bed7ef39e
parent 340935 589a01fb47900ae737c74f6b288d3245cece847e
child 340937 ca0345ae33a42ffc2ec9f776c1a2fe1280d615e7
push id36959
push useratolfsen@mozilla.com
push dateMon, 06 Feb 2017 16:56:36 +0000
treeherderautoland@c4441c1492fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1336124
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -2193,39 +2193,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(