mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 856043 - Test that the Restore Previous Session menu item is not displayed in private mode. r=ehsan
This commit is contained in:
parent
73a360f64e
commit
b2ebd7b3f2
@ -34,6 +34,7 @@ MOCHITEST_BROWSER_FILES = \
|
||||
browser_privatebrowsing_localStorage_page1.html \
|
||||
browser_privatebrowsing_localStorage_page2.html \
|
||||
browser_privatebrowsing_nonbrowser.js \
|
||||
browser_privatebrowsing_noSessionRestoreMenuOption.js \
|
||||
browser_privatebrowsing_opendir.js \
|
||||
browser_privatebrowsing_openlocation.js \
|
||||
browser_privatebrowsing_openLocationLastURL.js \
|
||||
|
@ -0,0 +1,34 @@
|
||||
/* 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/. */
|
||||
|
||||
// This test checks that the Session Restore menu option is not enabled in private mode
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
function testNoSessionRestoreMenuItem() {
|
||||
let win = OpenBrowserWindow({private: true});
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
ok(true, "The second private window got loaded");
|
||||
let srCommand = win.document.getElementById("Browser:RestoreLastSession");
|
||||
ok(srCommand, "The Session Restore command should exist");
|
||||
is(PrivateBrowsingUtils.isWindowPrivate(win), true,
|
||||
"PrivateBrowsingUtils should report the correct per-window private browsing status");
|
||||
is(srCommand.hasAttribute("disabled"), true,
|
||||
"The Session Restore command should be disabled in private browsing mode");
|
||||
win.close();
|
||||
finish();
|
||||
}, false);
|
||||
}
|
||||
|
||||
let win = OpenBrowserWindow({private: true});
|
||||
win.addEventListener("load", function onload() {
|
||||
win.removeEventListener("load", onload, false);
|
||||
ok(true, "The first private window got loaded");
|
||||
win.gBrowser.addTab("about:mozilla");
|
||||
win.close();
|
||||
testNoSessionRestoreMenuItem();
|
||||
}, false);
|
||||
}
|
Loading…
Reference in New Issue
Block a user