fune/browser/base/content/test/sanitize/browser_sanitize-passwordDisabledHosts.js
Victor Porof f9f5914039 Bug 1561435 - Format browser/base/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36041

--HG--
extra : source : 96b3895a3b2aa2fcb064c85ec5857b7216884556
2019-07-05 09:48:57 +02:00

28 lines
944 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();
});