Bug 1047603 - Make Marionette server force the initial browser to be remote when in an e10s window. r=? draft
authorMike Conley <mconley@mozilla.com>
Thu, 05 Feb 2015 17:56:43 -0500
changeset 241391 1ee0fada921d6619149ece76aa5ad5987168158f
parent 241390 edc69abf0e9b03ae858c4c9dc77e4c41110d98d4
child 241392 6bbd0e12e036a9a71db1b184b2a3ad2d94a19459
push id593
push usermconley@mozilla.com
push dateFri, 06 Feb 2015 20:14:17 +0000
bugs1047603
milestone38.0a1
Bug 1047603 - Make Marionette server force the initial browser to be remote when in an e10s window. r=? Marionette gets and holds the message manager for the initial browser when setting up a session. However, when starting up an e10s window, the initial browser is non-remote. When the browser starts opening a URI, it will usually transition to remote, which means that the initial message manager reference is no good (because the message manager for a browser that is remote is not the same after it has been made not remote, and vice versa). This patch causes us to force that initial browser to become remote so that by the time Marionette gets a reference to the message manager, it gets the right one.
testing/marionette/marionette-server.js
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -3148,16 +3148,21 @@ BrowserObj.prototype = {
         this.browser = win.BrowserApp;
         break;
     }
   },
   /**
    * Called when we start a session with this browser.
    */
   startSession: function BO_startSession(newSession, win, callback) {
+    if (appName == "Firefox" &&
+        win.gMultiProcessBrowser &&
+        !win.gBrowser.selectedBrowser.isRemoteBrowser) {
+      win.XULBrowserWindow.forceInitialBrowserRemote();
+    }
     callback(win, newSession);
   },
 
   /**
    * Closes current tab
    */
   closeTab: function BO_closeTab() {
     if (this.browser &&