Bug 943793 - Intermittent TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js. r=ehsan, a=test-only
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 10 Dec 2013 13:39:53 +0200
changeset 167680 36cbfe7a86599ce05537e4a4119a3188d623084b
parent 167679 ce6f41d388366602c59a38bfd89d50ea4c342873
child 167681 5fb33b37dc3294f52001e129bd595868a0474535
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
bugs943793
milestone27.0
Bug 943793 - Intermittent TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js. r=ehsan, a=test-only
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
@@ -1,33 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   waitForExplicitFinish();
 
+  const page1 = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
+                'browser_privatebrowsing_localStorage_page1.html'
+
   function checkLocalStorage(aWindow, aCallback) {
     executeSoon(function() {
       let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
       let browser = aWindow.gBrowser.selectedBrowser;
       browser.addEventListener('load', function() {
+        if (browser.contentWindow.location != page1) {
+          browser.loadURI(page1);
+          return;
+        }
         browser.removeEventListener('load', arguments.callee, true);
         let tab2 = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
         browser.contentWindow.location = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
                          'browser_privatebrowsing_localStorage_page2.html';
         browser.addEventListener('load', function() {
           browser.removeEventListener('load', arguments.callee, true);
           is(browser.contentWindow.document.title, '2', "localStorage should contain 2 items");
           aCallback();
         }, true);
       }, true);
-
-      browser.loadURI('http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
-                      'browser_privatebrowsing_localStorage_page1.html');
     });
   }
 
   let windowsToClose = [];
   function testOnWindow(options, callback) {
     let win = OpenBrowserWindow(options);
     win.addEventListener("load", function onLoad() {
       win.removeEventListener("load", onLoad, false);