75 function uri(aURIString)
77 return Cc[
"@mozilla.org/network/io-service;1"].
91 let
bh =
Cc[
"@mozilla.org/browser/global-history;2"].
93 bh.addPageWithDetails(aURI, aURI.spec, Date.now() * 1000);
107 let
gh =
Cc[
"@mozilla.org/browser/global-history;2"].
109 let checker = aIsVisited ? do_check_true : do_check_false;
110 checker(gh.isVisited(aURI));
121 let
cm =
Cc[
"@mozilla.org/cookiemanager;1"].getService(
Ci.nsICookieManager2);
137 let
cm =
Cc[
"@mozilla.org/cookiemanager;1"].getService(
Ci.nsICookieManager2);
143 let checker = aExists ? do_check_true : do_check_false;
144 checker(cm.cookieExists(cookie));
159 let db =
Cc[
"@mozilla.org/download-manager;1"].
162 let stmt = db.createStatement(
163 "INSERT INTO moz_downloads (source, state) " +
164 "VALUES (:source, :state)"
166 stmt.params.source = aURIString;
167 stmt.params.state = aIsActive ?
Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING :
168 Ci.nsIDownloadManager.DOWNLOAD_FINISHED;
188 let db =
Cc[
"@mozilla.org/download-manager;1"].
191 let stmt = db.createStatement(
193 "FROM moz_downloads " +
194 "WHERE source = :source"
196 stmt.params.source = aURIString;
198 let checker = aIsDownloaded ? do_check_true : do_check_false;
200 checker(stmt.step());
216 let lm =
Cc[
"@mozilla.org/login-manager;1"].
218 lm.setLoginSavingEnabled(
aHost,
false);
232 let lm =
Cc[
"@mozilla.org/login-manager;1"].
234 let checker = aIsDisabled ? do_check_false : do_check_true;
235 checker(lm.getLoginSavingEnabled(
aHost));
247 let login =
Cc[
"@mozilla.org/login-manager/loginInfo;1"].
251 let lm =
Cc[
"@mozilla.org/login-manager;1"].
267 let lm =
Cc[
"@mozilla.org/login-manager;1"].
283 let pm =
Cc[
"@mozilla.org/permissionmanager;1"].
299 let pm =
Cc[
"@mozilla.org/permissionmanager;1"].
302 let checker = aExists ?
do_check_eq : do_check_neq;
315 let cp =
Cc[
"@mozilla.org/content-pref/service;1"].
331 let cp =
Cc[
"@mozilla.org/content-pref/service;1"].
333 let checker = aExists ? do_check_true : do_check_false;
345 pb.removeDataFromDomain(
"mozilla.org");
351 const TEST_URI =
uri(
"http://www.mozilla.org/foo");
353 pb.removeDataFromDomain(
"mozilla.org");
359 const TEST_URI =
uri(
"http://ilovemozilla.org/foo");
361 pb.removeDataFromDomain(
"mozilla.org");
365 let
bh =
Cc[
"@mozilla.org/browser/global-history;2"].
373 const TEST_DOMAIN =
"mozilla.org";
375 pb.removeDataFromDomain(
"mozilla.org");
381 const TEST_DOMAIN =
"www.mozilla.org";
383 pb.removeDataFromDomain(
"mozilla.org");
389 const TEST_DOMAIN =
"ilovemozilla.org";
391 pb.removeDataFromDomain(
"mozilla.org");
398 const TEST_URI =
"http://mozilla.org/foo";
400 pb.removeDataFromDomain(
"mozilla.org");
406 const TEST_URI =
"http://www.mozilla.org/foo";
408 pb.removeDataFromDomain(
"mozilla.org");
415 const TEST_URI =
"http://mozilla.org/foo";
417 pb.removeDataFromDomain(
"mozilla.org");
421 let db =
Cc[
"@mozilla.org/download-manager;1"].
424 db.executeSimpleSQL(
"DELETE FROM moz_downloads");
431 const TEST_HOST =
"http://mozilla.org";
433 pb.removeDataFromDomain(
"mozilla.org");
439 const TEST_HOST =
"http://www.mozilla.org";
441 pb.removeDataFromDomain(
"mozilla.org");
447 const TEST_HOST =
"http://ilovemozilla.org";
449 pb.removeDataFromDomain(
"mozilla.org");
453 let lm =
Cc[
"@mozilla.org/login-manager;1"].
455 lm.setLoginSavingEnabled(TEST_HOST,
true);
461 const TEST_HOST =
"http://mozilla.org";
463 pb.removeDataFromDomain(
"mozilla.org");
469 const TEST_HOST =
"http://www.mozilla.org";
471 pb.removeDataFromDomain(
"mozilla.org");
477 const TEST_HOST =
"http://ilovemozilla.org";
479 pb.removeDataFromDomain(
"mozilla.org");
482 let lm =
Cc[
"@mozilla.org/login-manager;1"].
484 lm.removeAllLogins();
493 pb.removeDataFromDomain(
"mozilla.org");
501 pb.removeDataFromDomain(
"mozilla.org");
509 pb.removeDataFromDomain(
"mozilla.org");
513 let pm =
Cc[
"@mozilla.org/permissionmanager;1"].
524 pb.removeDataFromDomain(
"mozilla.org");
532 pb.removeDataFromDomain(
"mozilla.org");
540 pb.removeDataFromDomain(
"mozilla.org");
544 let cp =
Cc[
"@mozilla.org/content-pref/service;1"].
561 let
os =
Cc[
"@mozilla.org/observer-service;1"].
566 os.removeObserver(observer,
"cacheservice:empty-cache");
571 os.addObserver(observer,
"cacheservice:empty-cache",
false);
572 pb.removeDataFromDomain(
"mozilla.org");
617 for (let
i = 0;
i < tests.length;
i++)
function test_login_manager_disabled_hosts_cleared_with_subdomain()
do_check_eq(typeof PlacesUtils,"object")
function test_download_history_cleared_with_subdomain()
function check_preference_exists(aURI, aExists)
function check_downloaded(aURIString, aIsDownloaded)
function test_content_preferences_cleared_with_subdomain()
function test_download_history_not_cleared_with_active_direct_match()
function test_cookie_cleared_with_direct_match()
function shutdownPlaces()
function add_permission(aURI)
function test_login_manager_disabled_hosts_cleared_with_direct_match()
function check_disabled_host(aHost, aIsDisabled)
function check_cookie_exists(aDomain, aExists)
function check_visited(aURI, aIsVisited)
function test_permission_manager_not_cleared_with_uri_contains_domain()
getService(Ci.sbIFaceplateManager)
function check_permission_exists(aURI, aExists)
function test_content_preferecnes_not_cleared_with_uri_contains_domain()
function test_history_cleared_with_direct_match()
function test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain()
function test_login_manager_logins_cleared_with_subdomain()
function check_login_exists(aHost, aExists)
function test_login_manager_logins_cleared_with_direct_match()
function test_history_not_cleared_with_uri_contains_domain()
const LOGIN_USERNAME_FIELD
function test_cache_cleared()
function test_history_cleared_with_subdomain()
function newURI(aURLString)
const LOGIN_PASSWORD_FIELD
return!aWindow arguments!aWindow arguments[0]
function test_download_history_cleared_with_direct_match()
function add_disabled_host(aHost)
function add_download(aURIString, aIsActive)
function test_permission_manager_cleared_with_direct_match()
function add_cookie(aDomain)
function add_preference(aURI)
function tets_login_manager_logins_not_cleared_with_uri_contains_domain()
function test_cookie_cleared_with_subdomain()
function test_cookie_not_cleared_with_uri_contains_domain()
function add_login(aHost)
var PRIVATEBROWSING_CONTRACT_ID
_getSelectedPageStyle s i
function test_content_preferences_cleared_with_direct_match()
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe
function test_permission_manager_cleared_with_subdomain()