forked from mirrors/gecko-dev
The shims that this rule tests for no longer exist. MozReview-Commit-ID: DMgP7Hczavc --HG-- extra : rebase_source : 765ddd5c62c9449c07ed050e44d86a3bd5c0ae64 extra : amend_source : 627a7694ac07182200f876901ded7a34721cd228
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
"use strict";
|
|
|
|
function switchToCustomHistoryMode(doc) {
|
|
// Select the last item in the menulist.
|
|
let menulist = doc.getElementById("historyMode");
|
|
menulist.focus();
|
|
EventUtils.sendKey("UP");
|
|
}
|
|
|
|
function testPrefStateMatchesLockedState() {
|
|
let win = gBrowser.contentWindow;
|
|
let doc = win.document;
|
|
switchToCustomHistoryMode(doc);
|
|
|
|
let checkbox = doc.getElementById("alwaysClear");
|
|
let preference = win.Preferences.get("privacy.sanitize.sanitizeOnShutdown");
|
|
is(checkbox.disabled, preference.locked, "Always Clear checkbox should be enabled when preference is not locked.");
|
|
|
|
Services.prefs.clearUserPref("privacy.history.custom");
|
|
gBrowser.removeCurrentTab();
|
|
}
|
|
|
|
add_task(function setup() {
|
|
registerCleanupFunction(function resetPreferences() {
|
|
Services.prefs.unlockPref("privacy.sanitize.sanitizeOnShutdown");
|
|
Services.prefs.clearUserPref("privacy.history.custom");
|
|
});
|
|
});
|
|
|
|
add_task(async function test_preference_enabled_when_unlocked() {
|
|
await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
|
|
testPrefStateMatchesLockedState();
|
|
});
|
|
|
|
add_task(async function test_preference_disabled_when_locked() {
|
|
Services.prefs.lockPref("privacy.sanitize.sanitizeOnShutdown");
|
|
await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
|
|
testPrefStateMatchesLockedState();
|
|
});
|