2009-01-20 07:59:49 -08:00
|
|
|
// Bug 380852 - Delete permission manager entries in Clear Recent History
|
|
|
|
|
2009-07-27 23:18:29 -07:00
|
|
|
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
|
2009-01-20 07:59:49 -08:00
|
|
|
.loadSubScript("chrome://browser/content/sanitize.js");
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
|
|
|
|
// Add a permission entry
|
2010-04-03 00:36:55 -07:00
|
|
|
var pm = Services.perms;
|
2009-07-28 00:09:50 -07:00
|
|
|
pm.add(makeURI("http://example.com"), "testing", pm.ALLOW_ACTION);
|
2009-01-20 07:59:49 -08:00
|
|
|
|
|
|
|
// Sanity check
|
|
|
|
ok(pm.enumerator.hasMoreElements(), "Permission manager should have elements, since we just added one");
|
|
|
|
|
|
|
|
// Set up the sanitizer to just clear siteSettings
|
|
|
|
let s = new Sanitizer();
|
|
|
|
s.ignoreTimespan = false;
|
|
|
|
s.prefDomain = "privacy.cpd.";
|
2009-07-27 23:18:29 -07:00
|
|
|
var itemPrefs = gPrefService.getBranch(s.prefDomain);
|
2009-01-20 07:59:49 -08:00
|
|
|
itemPrefs.setBoolPref("history", false);
|
|
|
|
itemPrefs.setBoolPref("downloads", false);
|
|
|
|
itemPrefs.setBoolPref("cache", false);
|
|
|
|
itemPrefs.setBoolPref("cookies", false);
|
|
|
|
itemPrefs.setBoolPref("formdata", false);
|
|
|
|
itemPrefs.setBoolPref("offlineApps", false);
|
|
|
|
itemPrefs.setBoolPref("passwords", false);
|
|
|
|
itemPrefs.setBoolPref("sessions", false);
|
|
|
|
itemPrefs.setBoolPref("siteSettings", true);
|
|
|
|
|
|
|
|
// Clear it
|
|
|
|
s.sanitize();
|
|
|
|
|
|
|
|
// Make sure it's gone
|
|
|
|
ok(!pm.enumerator.hasMoreElements(), "Permission manager shouldn't have entries after Sanitizing");
|
|
|
|
}
|