fune/browser/base/content/test/sanitize/browser_sanitize-passwordDisabledHosts.js
Johann Hofmann 8a87220e95 Bug 1167238 - Part 4 - Move sanitize tests into a topical directory and clean up sanitize.js usage. r=mak
We're changing the way sanitize.js/Sanitizer.jsm works and need to adjust a lot of tests to that.
I'm using this opportunity to also move the sanitization tests into their
own topical directory and out of b/b/c/test/general.

MozReview-Commit-ID: GHOqr4hT52b

--HG--
rename : browser/base/content/test/general/browser_purgehistory_clears_sh.js => browser/base/content/test/sanitize/browser_purgehistory_clears_sh.js
rename : browser/base/content/test/general/browser_bug409624.js => browser/base/content/test/sanitize/browser_sanitize-formhistory.js
rename : browser/base/content/test/general/browser_sanitize-passwordDisabledHosts.js => browser/base/content/test/sanitize/browser_sanitize-passwordDisabledHosts.js
rename : browser/base/content/test/general/browser_sanitize-sitepermissions.js => browser/base/content/test/sanitize/browser_sanitize-sitepermissions.js
rename : browser/base/content/test/general/browser_sanitize-timespans.js => browser/base/content/test/sanitize/browser_sanitize-timespans.js
rename : browser/base/content/test/general/browser_sanitizeDialog.js => browser/base/content/test/sanitize/browser_sanitizeDialog.js
extra : rebase_source : 10577846b8a407d12f7459b270a5c5573cd425ad
2018-01-18 16:05:36 +01:00

22 lines
920 B
JavaScript

// Bug 474792 - Clear "Never remember passwords for this site" when
// clearing site-specific settings in Clear Recent History dialog
add_task(async function() {
// getLoginSavingEnabled always returns false if password capture is disabled.
await SpecialPowers.pushPrefEnv({"set": [["signon.rememberSignons", true]]});
// Add a disabled host
Services.logins.setLoginSavingEnabled("http://example.com", false);
// Sanity check
is(Services.logins.getLoginSavingEnabled("http://example.com"), false,
"example.com should be disabled for password saving since we haven't cleared that yet.");
// Clear it
await Sanitizer.sanitize(["siteSettings"], {ignoreTimespan: false});
// Make sure it's gone
is(Services.logins.getLoginSavingEnabled("http://example.com"), true,
"example.com should be enabled for password saving again now that we've cleared.");
await SpecialPowers.popPrefEnv();
});