mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 1132566 - Make test e10s compatible: browser_privatebrowsing_aboutSessionRestore.js; r=mconley
--HG-- extra : rebase_source : ee1a30a47685958a856e97d6e5d9b510e95afb39
This commit is contained in:
parent
5dbc4699a0
commit
e4d7dc3994
@ -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]
|
||||
|
@ -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();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user