diff --git a/browser/base/content/test/tabview/browser_tabview_privatebrowsing.js b/browser/base/content/test/tabview/browser_tabview_privatebrowsing.js index aae8979f1497..4160fd1c5907 100644 --- a/browser/base/content/test/tabview/browser_tabview_privatebrowsing.js +++ b/browser/base/content/test/tabview/browser_tabview_privatebrowsing.js @@ -22,7 +22,7 @@ function onTabViewLoadedAndShown() { ok(TabView.isVisible(), "Tab View is visible"); // Establish initial state - contentWindow = document.getElementById("tab-view").contentWindow; + contentWindow = TabView.getContentWindow(); verifyCleanState("start"); // register a clean up for private browsing just in case @@ -50,40 +50,37 @@ function onTabViewLoadedAndShown() { } // Create a second tab - gBrowser.loadOneTab("about:robots", { inBackground: false }); + gBrowser.addTab("about:robots"); is(gBrowser.tabs.length, 2, "we now have 2 tabs"); registerCleanupFunction(function() { gBrowser.removeTab(gBrowser.tabs[1]); }); afterAllTabsLoaded(function() { - showTabView(function() { - // Get normal tab urls - for (let a = 0; a < gBrowser.tabs.length; a++) - normalURLs.push(gBrowser.tabs[a].linkedBrowser.currentURI.spec); + // Get normal tab urls + for (let a = 0; a < gBrowser.tabs.length; a++) + normalURLs.push(gBrowser.tabs[a].linkedBrowser.currentURI.spec); - // verify that we're all set up for our test - verifyNormal(); + // verify that we're all set up for our test + verifyNormal(); - // go into private browsing and make sure Tab View becomes hidden - togglePBAndThen(function() { - whenTabViewIsHidden(function() { - ok(!TabView.isVisible(), "Tab View is no longer visible"); + // go into private browsing and make sure Tab View becomes hidden + togglePBAndThen(function() { + whenTabViewIsHidden(function() { + ok(!TabView.isVisible(), "Tab View is no longer visible"); + verifyPB(); - verifyPB(); + // exit private browsing and make sure Tab View is shown again + togglePBAndThen(function() { + whenTabViewIsShown(function() { + ok(TabView.isVisible(), "Tab View is visible again"); + verifyNormal(); - // exit private browsing and make sure Tab View is shown again - togglePBAndThen(function() { - whenTabViewIsShown(function() { - ok(TabView.isVisible(), "Tab View is visible again"); - verifyNormal(); - - hideTabView(onTabViewHidden); - }); + hideTabView(onTabViewHidden); }); }); }); - }); + }); }); }