diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js')
-rw-r--r-- | browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js b/browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js new file mode 100644 index 000000000..6b587e036 --- /dev/null +++ b/browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js @@ -0,0 +1,37 @@ +"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 = doc.getElementById("privacy.sanitize.sanitizeOnShutdown"); + is(checkbox.disabled, preference.locked, "Always Clear checkbox should be enabled when preference is not locked."); + + gBrowser.removeCurrentTab(); +} + +add_task(function setup() { + registerCleanupFunction(function resetPreferences() { + Services.prefs.unlockPref("privacy.sanitize.sanitizeOnShutdown"); + }); +}); + +add_task(function* test_preference_enabled_when_unlocked() { + yield openPreferencesViaOpenPreferencesAPI("panePrivacy", undefined, {leaveOpen: true}); + testPrefStateMatchesLockedState(); +}); + +add_task(function* test_preference_disabled_when_locked() { + Services.prefs.lockPref("privacy.sanitize.sanitizeOnShutdown"); + yield openPreferencesViaOpenPreferencesAPI("panePrivacy", undefined, {leaveOpen: true}); + testPrefStateMatchesLockedState(); +}); |