mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 806698 - Port browser_privatebrowsing_theming.js to the new per-window PB APIs; r=jdm
--HG-- rename : browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_theming.js => browser/components/privatebrowsing/test/browser/perwindow/browser_privatebrowsing_theming.js
This commit is contained in:
parent
1c2b6fe0b3
commit
a30f6c598a
@ -19,6 +19,7 @@ MOCHITEST_BROWSER_FILES = \
|
||||
browser_privatebrowsing_crh.js \
|
||||
browser_privatebrowsing_lastpbcontextexited.js \
|
||||
browser_privatebrowsing_opendir.js \
|
||||
browser_privatebrowsing_theming.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -0,0 +1,38 @@
|
||||
/* 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 makes sure that privatebrowsingmode attribute of the window is correctly
|
||||
// adjusted based on whether the window is a private window.
|
||||
|
||||
var windowsToClose = [];
|
||||
function testOnWindow(options, callback) {
|
||||
var win = OpenBrowserWindow(options);
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
windowsToClose.push(win);
|
||||
executeSoon(function() callback(win));
|
||||
}, false);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
windowsToClose.forEach(function(win) {
|
||||
win.close();
|
||||
});
|
||||
});
|
||||
|
||||
function test() {
|
||||
// initialization
|
||||
waitForExplicitFinish();
|
||||
|
||||
ok(!document.documentElement.hasAttribute("privatebrowsingmode"),
|
||||
"privatebrowsingmode should not be present in normal mode");
|
||||
|
||||
// open a private window
|
||||
testOnWindow({private: true}, function(win) {
|
||||
is(win.document.documentElement.getAttribute("privatebrowsingmode"), "temporary",
|
||||
"privatebrowsingmode should be \"temporary\" inside the private browsing mode");
|
||||
|
||||
finish();
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user