tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_sanitize-passwordDisabledHosts.js (948B)


      1 // Bug 474792 - Clear "Never remember passwords for this site" when
      2 // clearing site-specific settings in Clear Recent History dialog
      3 
      4 add_task(async function () {
      5  // getLoginSavingEnabled always returns false if password capture is disabled.
      6  await SpecialPowers.pushPrefEnv({ set: [["signon.rememberSignons", true]] });
      7 
      8  // Add a disabled host
      9  Services.logins.setLoginSavingEnabled("https://example.com", false);
     10  // Sanity check
     11  is(
     12    Services.logins.getLoginSavingEnabled("https://example.com"),
     13    false,
     14    "example.com should be disabled for password saving since we haven't cleared that yet."
     15  );
     16 
     17  // Clear it
     18  await Sanitizer.sanitize(["siteSettings"], { ignoreTimespan: false });
     19 
     20  // Make sure it's gone
     21  is(
     22    Services.logins.getLoginSavingEnabled("https://example.com"),
     23    true,
     24    "example.com should be enabled for password saving again now that we've cleared."
     25  );
     26 
     27  await SpecialPowers.popPrefEnv();
     28 });