forked from mirrors/gecko-dev
Enabled ESLint for: * docshell/test/navigation/** * docshell/test/unit/** * docshell/test/unit_ipc/** Changed .eslintignore to allow for this and ran ./mach eslint --fix on the above directories and checked automatic fixes Differential Revision: https://phabricator.services.mozilla.com/D9430 --HG-- extra : moz-landing-system : lando
20 lines
655 B
JavaScript
20 lines
655 B
JavaScript
var gNotifications = 0;
|
|
|
|
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|
|
|
var observer = {
|
|
QueryInterface: ChromeUtils.generateQI(["nsIPrivacyTransitionObserver", "nsISupportsWeakReference"]),
|
|
|
|
privateModeChanged(enabled) {
|
|
gNotifications++;
|
|
},
|
|
};
|
|
|
|
function run_test() {
|
|
let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
|
|
windowlessBrowser.docShell.addWeakPrivacyTransitionObserver(observer);
|
|
windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId: 1});
|
|
windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId: 0});
|
|
windowlessBrowser.close();
|
|
Assert.equal(gNotifications, 2);
|
|
}
|