Bug 950337 - Random failures in privatebrowsing/test/browser/browser_privatebrowsing_cache.js, r=ehsan
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 17 Dec 2013 15:13:43 +0200
changeset 171025 be08b976b3151c7796af6ad1f435f3276ca7593a
parent 171024 aa29a685d8359e25db062bee9c5750f18ff9cddd
child 171026 dacb4796c71c836612bcadcc243a18e5d946de04
push id5166
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:47:54 +0000
treeherdermozilla-aurora@977eb2548b2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs950337
milestone29.0a1
Bug 950337 - Random failures in privatebrowsing/test/browser/browser_privatebrowsing_cache.js, r=ehsan
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
@@ -98,19 +98,17 @@ function getStorageEntryCount(device, go
       goon(this.entryCount);
     }
   };
 
   storage.asyncVisitStorage(visitor, true);
 }
 
 function get_cache_for_private_window () {
-  let win = OpenBrowserWindow({private: true});
-  win.addEventListener("load", function () {
-    win.removeEventListener("load", arguments.callee, false);
+  let win = whenNewWindowLoaded({private: true}, function() {
 
     executeSoon(function() {
 
       ok(true, "The private window got loaded");
 
       let tab = win.gBrowser.addTab("http://example.org");
       win.gBrowser.selectedTab = tab;
       let newTabBrowser = win.gBrowser.getBrowserForTab(tab);
@@ -130,10 +128,10 @@ function get_cache_for_private_window ()
 
               win.close();
               finish();
             });
           });
         });
       }, true);
     });
-  }, false);
+  });
 }