Bug 1047603 - Fix browser_394759_behaviour.js test. r=ttaubert.
authorMike Conley <mconley@mozilla.com>
Mon, 26 Jan 2015 15:21:34 -0500
changeset 228525 be43b4de674dac19ea48a5ed23d7bb64fca734fd
parent 228524 573126edf2c8e851dc44bc2348af056994537f43
child 228526 179ab8bb80aeb209b9c7ce2565defa1395ed9e02
push id28264
push usercbook@mozilla.com
push dateWed, 11 Feb 2015 13:58:35 +0000
treeherdermozilla-central@38058cb42a0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1047603
milestone38.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 1047603 - Fix browser_394759_behaviour.js test. r=ttaubert. Turns out this test wasn't accustomed to newly created windows having initially non-remote browsers, and that we need to wait for them to redirect and restore in the content process before we can properly serialize the window.
browser/components/sessionstore/test/browser_394759_behavior.js
--- a/browser/components/sessionstore/test/browser_394759_behavior.js
+++ b/browser/components/sessionstore/test/browser_394759_behavior.js
@@ -34,21 +34,33 @@ function test() {
 
     // hack to force window to be considered a popup (toolbar=no didn't work)
     let winData = windowsToOpen.shift();
     let settings = "chrome,dialog=no," +
                    (winData.isPopup ? "all=no" : "all");
     let url = "http://example.com/?window=" + windowsToOpen.length;
 
     provideWindow(function onTestURLLoaded(win) {
-      win.close();
-      // Give it time to close
-      executeSoon(function() {
-        openWindowRec(windowsToOpen, expectedResults, recCallback);
-      });
+      let tabReady = () => {
+        win.close();
+        // Give it time to close
+        executeSoon(function() {
+          openWindowRec(windowsToOpen, expectedResults, recCallback);
+        });
+      };
+
+      if (win.gMultiProcessBrowser) {
+        let tab = win.gBrowser.selectedTab;
+        tab.addEventListener("SSTabRestored", function onTabRestored() {
+          tab.removeEventListener("SSTabRestored", onTabRestored);
+          tabReady();
+        });
+      } else {
+        tabReady();
+      }
     }, url, settings);
   }
 
   let windowsToOpen = [{isPopup: false},
                        {isPopup: false},
                        {isPopup: true},
                        {isPopup: true},
                        {isPopup: true}];