Bug 1110887 - Uplift BrowserTestUtils changes. a=test-only
authorMike Conley <mconley@mozilla.com>
Fri, 27 Mar 2015 16:32:24 -0400
changeset 267517 eff3a3e4e107a3e18f40af7363f070747949c316
parent 267512 91cd2fcb1fd50958700002a92c70b18021ac5368
child 267518 5d6394efb2950c03d28f4d246705b77ad3eefa63
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1110887
milestone39.0
Bug 1110887 - Uplift BrowserTestUtils changes. a=test-only
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
--- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ -168,30 +168,38 @@ this.BrowserTestUtils = {
     });
   },
 
   /**
    * @param {Object} options
    *        {
    *          private: A boolean indicating if the window should be
    *                   private
+   *          remote:  A boolean indicating if the window should run
+   *                   remote browser tabs or not. If omitted, the window
+   *                   will choose the profile default state.
    *        }
    * @return {Promise}
    *         Resolves with the new window once it is loaded.
    */
-  openNewBrowserWindow(options) {
+  openNewBrowserWindow(options={}) {
     let argString = Cc["@mozilla.org/supports-string;1"].
                     createInstance(Ci.nsISupportsString);
     argString.data = "";
     let features = "chrome,dialog=no,all";
 
-    if (options && options.private || false) {
+    if (options.private) {
       features += ",private";
     }
 
+    if (options.hasOwnProperty("remote")) {
+      let remoteState = options.remote ? "remote" : "non-remote";
+      features += `,${remoteState}`;
+    }
+
     let win = Services.ww.openWindow(
       null, Services.prefs.getCharPref("browser.chromeURL"), "_blank",
       features, argString);
 
     // Wait for browser-delayed-startup-finished notification, it indicates
     // that the window has loaded completely and is ready to be used for
     // testing.
     return TestUtils.topicObserved("browser-delayed-startup-finished",