Bug 1336124 - Remove unused B2G code in session teardown. r=maja_zf, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 16:10:18 +0000
changeset 378246 8ab5323b26bd78946c40b631953c70b2c87a2b6c
parent 378245 73551688c6ac22ec1d479ef77f519fd212a90cc9
child 378247 e007ff236f9a0e5932c9da3aefb6f78d0a60de51
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1336124
milestone53.0a2
Bug 1336124 - Remove unused B2G code in session teardown. r=maja_zf, a=test-only MozReview-Commit-ID: CHmdB7BvBT8
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2178,39 +2178,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(