Bug 945979 - Intermittent browser_privatebrowsing_geoprompt.js. r=ehsan, a=test-only
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 10 Dec 2013 13:40:35 +0200
changeset 175214 fba49bea43cb4ac2b3f908bbe127953d98d08aee
parent 175213 8ee3dc82cd3addf3867a29f574215606f85bc9c5
child 175215 f9ae278dead754490b718e63149ebd2159fc819d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, test-only
bugs945979
milestone28.0a2
Bug 945979 - Intermittent browser_privatebrowsing_geoprompt.js. r=ehsan, a=test-only
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js
@@ -9,20 +9,24 @@ function test() {
   waitForExplicitFinish();
 
   function testNoSessionRestoreButton() {
     let win = OpenBrowserWindow({private: true});
     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:home");
+        let newTab = win.gBrowser.addTab();
         win.gBrowser.selectedTab = newTab;
         let tabBrowser = win.gBrowser.getBrowserForTab(newTab);
         tabBrowser.addEventListener("load", function tabLoadListener() {
+          if (win.content.location != "about:home") {
+            win.content.location = "about:home";
+            return;
+          }
           tabBrowser.removeEventListener("load", tabLoadListener, true);
           executeSoon(function() {
             info("about:home got loaded");
             let sessionRestoreButton = win.gBrowser
                                           .contentDocument
                                           .getElementById("restorePreviousSession");
             is(win.getComputedStyle(sessionRestoreButton).display, 
                "none", "The Session Restore about:home button should be disabled");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
@@ -9,16 +9,20 @@ function test() {
   const testPageURL = "http://mochi.test:8888/browser/" +
     "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
   waitForExplicitFinish();
 
     function checkGeolocation(aPrivateMode, aWindow, aCallback) {
     executeSoon(function() {
       aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
       aWindow.gBrowser.selectedBrowser.addEventListener("load", function () {
+        if (aWindow.content.location != testPageURL) {
+          aWindow.content.location = testPageURL;
+          return;
+        }
         aWindow.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
         function runTest() {
           let notification = aWindow.PopupNotifications.getNotification("geolocation");
           if (!notification) {
             // Wait until the notification is available
             executeSoon(runTest);
             return;
@@ -31,17 +35,16 @@ function test() {
           }
           notification.remove();
 
           aWindow.gBrowser.removeCurrentTab();
           aCallback();
         }
         runTest();
       }, true);
-      aWindow.content.location = testPageURL;
     });
   };
 
   let windowsToClose = [];
   function testOnWindow(options, callback) {
     let win = OpenBrowserWindow(options);
     win.addEventListener("load", function onLoad() {
       win.removeEventListener("load", onLoad, false);