diff --git a/browser/components/privatebrowsing/test/browser/browser.ini b/browser/components/privatebrowsing/test/browser/browser.ini index 5af03618712..9a81817eaa9 100644 --- a/browser/components/privatebrowsing/test/browser/browser.ini +++ b/browser/components/privatebrowsing/test/browser/browser.ini @@ -22,7 +22,6 @@ skip-if = true # Bug 1142678 - Loading a message sending frame script into a pri [browser_privatebrowsing_aboutHomeButtonAfterWindowClose_old.js] skip-if = e10s [browser_privatebrowsing_aboutSessionRestore.js] -skip-if = e10s [browser_privatebrowsing_cache.js] skip-if = e10s [browser_privatebrowsing_certexceptionsui.js] diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js index 610304fc1fe..96dafe8555f 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js @@ -4,46 +4,21 @@ // This test checks that the session restore button from about:sessionrestore // is disabled in private mode +add_task(function* testNoSessionRestoreButton() { + // Opening, then closing, a private window shouldn't create session data. + (yield BrowserTestUtils.openNewBrowserWindow({private: true})).close(); -function test() { - waitForExplicitFinish(); + let win = yield BrowserTestUtils.openNewBrowserWindow({private: true}); + let tab = win.gBrowser.addTab("about:sessionrestore"); + let browser = tab.linkedBrowser; - 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: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(); - finish(); - }); - }, true); - }); - }, false); - } + yield BrowserTestUtils.browserLoaded(browser); - let win = OpenBrowserWindow({private: true}); - win.addEventListener("load", function onload() { - win.removeEventListener("load", onload, false); - executeSoon(function() { - info("The first private window got loaded"); - win.close(); - testNoSessionRestoreButton(); - }); - }, false); -} + let disabled = yield ContentTask.spawn(browser, {}, function* (){ + return content.document.getElementById("errorTryAgain").disabled; + }); + + ok(disabled, "The Restore about:sessionrestore button should be disabled"); + + win.close(); +});