Bug 1430077 - Broadcast Marionette:Deregister once. r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Fri, 12 Jan 2018 13:24:54 +0000
changeset 453638 989f852dc1a8b6531b24de5741b4b56a151f1954
parent 453637 073eb94e1d21ce20fa1452d65be4f4fc420fe0d8
child 453639 8c33350d63a22e035575054950a57f14083cdcbe
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1430077
milestone59.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 1430077 - Broadcast Marionette:Deregister once. r=whimboo The global message manager reaches all browsers and all frames. If Marionette was _not_ using the global message manager, this would have been the correct approach. MozReview-Commit-ID: HKrlfd9pzK2
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2762,23 +2762,17 @@ GeckoDriver.prototype.closeChromeWindow 
 };
 
 /** Delete Marionette session. */
 GeckoDriver.prototype.deleteSession = function() {
   if (this.curBrowser !== null) {
     // frame scripts can be safely reused
     Preferences.set(CONTENT_LISTENER_PREF, false);
 
-    // clean up state in each frame in each browser
-    for (let win in this.browsers) {
-      let browser = this.browsers[win];
-      browser.knownFrames.forEach(() => {
-        globalMessageManager.broadcastAsyncMessage("Marionette:Deregister");
-      });
-    }
+    globalMessageManager.broadcastAsyncMessage("Marionette:Deregister");
 
     for (let win of this.windows) {
       if (win.messageManager) {
         win.messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
       } else {
         logger.error(
             `Could not remove listener from page ${win.location.href}`);
       }