Bug 944126 - Random failures with browser_privatebrowsing_aboutSessionRestore.js. r=ehsan, a=test-only
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 28 Nov 2013 18:50:18 +0200
changeset 167770 9f4b4417d125f472ab2edacb0fee72438f6839af
parent 167769 48950cec965531946b634ef8d7ac755851bc2784
child 167771 b7c9e1ddcf5a8528174740f662f1c68e64434759
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, test-only
bugs944126
milestone27.0
Bug 944126 - Random failures with browser_privatebrowsing_aboutSessionRestore.js. r=ehsan, a=test-only
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
@@ -13,16 +13,20 @@ function test() {
     win.addEventListener("load", function onLoad() {
       win.removeEventListener("load", onLoad, false);
       executeSoon(function() {
         info("The second private window got loaded");
         let newTab = win.gBrowser.addTab("about:sessionrestore");
         win.gBrowser.selectedTab = newTab;
         let tabBrowser = win.gBrowser.getBrowserForTab(newTab);
         tabBrowser.addEventListener("load", function tabLoadListener() {
+          if (win.gBrowser.contentWindow.location != "about:sessionrestore") {
+            win.gBrowser.selectedBrowser.loadURI("about:sessionrestore");
+            return;
+          }
           tabBrowser.removeEventListener("load", tabLoadListener, true);
           executeSoon(function() {
             info("about:sessionrestore got loaded");
             let restoreButton = win.gBrowser.contentDocument
                                             .getElementById("errorTryAgain");
             ok(restoreButton.disabled,
                "The Restore about:sessionrestore button should be disabled");
             win.close();