diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-24 19:34:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 19:34:58 +0200 |
commit | 1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1 (patch) | |
tree | 749b48be1987507e6e5be0bc3e3673f0f7d9dd73 /toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js | |
parent | 844da2ccc666afa713ca1e3e7caa077de4a9250d (diff) | |
parent | 846bbb9930e6588516a28f58b2f80c2b04e1b372 (diff) | |
download | UXP-1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1.tar UXP-1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1.tar.gz UXP-1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1.tar.lz UXP-1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1.tar.xz UXP-1b0a03a2e1916efd5c4f76efbe24b5917aa0d4c1.zip |
Merge pull request #258 from janekptacijarabaci/forgetAboutSite_1
moebius#30 and #37: ForgetAboutSite.jsm - promise - serialize vs. parallel + a comment
Diffstat (limited to 'toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js')
-rw-r--r-- | toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js index f6ace1e64..d2db95e6a 100644 --- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js +++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js @@ -257,7 +257,7 @@ function* test_history_cleared_with_direct_match() do_check_false(yield promiseIsURIVisited(TEST_URI)); yield PlacesTestUtils.addVisits(TEST_URI); do_check_true(yield promiseIsURIVisited(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); do_check_false(yield promiseIsURIVisited(TEST_URI)); } @@ -267,7 +267,7 @@ function* test_history_cleared_with_subdomain() do_check_false(yield promiseIsURIVisited(TEST_URI)); yield PlacesTestUtils.addVisits(TEST_URI); do_check_true(yield promiseIsURIVisited(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); do_check_false(yield promiseIsURIVisited(TEST_URI)); } @@ -277,7 +277,7 @@ function* test_history_not_cleared_with_uri_contains_domain() do_check_false(yield promiseIsURIVisited(TEST_URI)); yield PlacesTestUtils.addVisits(TEST_URI); do_check_true(yield promiseIsURIVisited(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); do_check_true(yield promiseIsURIVisited(TEST_URI)); // Clear history since we left something there from this test. @@ -285,52 +285,52 @@ function* test_history_not_cleared_with_uri_contains_domain() } // Cookie Service -function test_cookie_cleared_with_direct_match() +function* test_cookie_cleared_with_direct_match() { const TEST_DOMAIN = "mozilla.org"; add_cookie(TEST_DOMAIN); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_cookie_exists(TEST_DOMAIN, false); } -function test_cookie_cleared_with_subdomain() +function* test_cookie_cleared_with_subdomain() { const TEST_DOMAIN = "www.mozilla.org"; add_cookie(TEST_DOMAIN); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_cookie_exists(TEST_DOMAIN, false); } -function test_cookie_not_cleared_with_uri_contains_domain() +function* test_cookie_not_cleared_with_uri_contains_domain() { const TEST_DOMAIN = "ilovemozilla.org"; add_cookie(TEST_DOMAIN); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_cookie_exists(TEST_DOMAIN, true); } // Login Manager -function test_login_manager_disabled_hosts_cleared_with_direct_match() +function* test_login_manager_disabled_hosts_cleared_with_direct_match() { const TEST_HOST = "http://mozilla.org"; add_disabled_host(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_disabled_host(TEST_HOST, false); } -function test_login_manager_disabled_hosts_cleared_with_subdomain() +function* test_login_manager_disabled_hosts_cleared_with_subdomain() { const TEST_HOST = "http://www.mozilla.org"; add_disabled_host(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_disabled_host(TEST_HOST, false); } -function test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain() +function* test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain() { const TEST_HOST = "http://ilovemozilla.org"; add_disabled_host(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_disabled_host(TEST_HOST, true); // Reset state @@ -340,27 +340,27 @@ function test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain( check_disabled_host(TEST_HOST, false); } -function test_login_manager_logins_cleared_with_direct_match() +function* test_login_manager_logins_cleared_with_direct_match() { const TEST_HOST = "http://mozilla.org"; add_login(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_login_exists(TEST_HOST, false); } -function test_login_manager_logins_cleared_with_subdomain() +function* test_login_manager_logins_cleared_with_subdomain() { const TEST_HOST = "http://www.mozilla.org"; add_login(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_login_exists(TEST_HOST, false); } -function test_login_manager_logins_not_cleared_with_uri_contains_domain() +function* test_login_manager_logins_not_cleared_with_uri_contains_domain() { const TEST_HOST = "http://ilovemozilla.org"; add_login(TEST_HOST); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_login_exists(TEST_HOST, true); let lm = Cc["@mozilla.org/login-manager;1"]. @@ -370,27 +370,27 @@ function test_login_manager_logins_not_cleared_with_uri_contains_domain() } // Permission Manager -function test_permission_manager_cleared_with_direct_match() +function* test_permission_manager_cleared_with_direct_match() { const TEST_URI = uri("http://mozilla.org"); add_permission(TEST_URI); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_permission_exists(TEST_URI, false); } -function test_permission_manager_cleared_with_subdomain() +function* test_permission_manager_cleared_with_subdomain() { const TEST_URI = uri("http://www.mozilla.org"); add_permission(TEST_URI); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_permission_exists(TEST_URI, false); } -function test_permission_manager_not_cleared_with_uri_contains_domain() +function* test_permission_manager_not_cleared_with_uri_contains_domain() { const TEST_URI = uri("http://ilovemozilla.org"); add_permission(TEST_URI); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); check_permission_exists(TEST_URI, true); // Reset state @@ -427,7 +427,7 @@ function* test_content_preferences_cleared_with_direct_match() do_check_false(yield preference_exists(TEST_URI)); yield add_preference(TEST_URI); do_check_true(yield preference_exists(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); yield waitForPurgeNotification(); do_check_false(yield preference_exists(TEST_URI)); } @@ -438,7 +438,7 @@ function* test_content_preferences_cleared_with_subdomain() do_check_false(yield preference_exists(TEST_URI)); yield add_preference(TEST_URI); do_check_true(yield preference_exists(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); yield waitForPurgeNotification(); do_check_false(yield preference_exists(TEST_URI)); } @@ -449,12 +449,12 @@ function* test_content_preferences_not_cleared_with_uri_contains_domain() do_check_false(yield preference_exists(TEST_URI)); yield add_preference(TEST_URI); do_check_true(yield preference_exists(TEST_URI)); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); yield waitForPurgeNotification(); do_check_true(yield preference_exists(TEST_URI)); // Reset state - ForgetAboutSite.removeDataFromDomain("ilovemozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("ilovemozilla.org"); yield waitForPurgeNotification(); do_check_false(yield preference_exists(TEST_URI)); } @@ -535,7 +535,7 @@ function* test_push_cleared() } // Cache -function test_cache_cleared() +function* test_cache_cleared() { // Because this test is asynchronous, it should be the last test do_check_true(tests[tests.length - 1] == arguments.callee); @@ -557,7 +557,7 @@ function test_cache_cleared() } }; os.addObserver(observer, "cacheservice:empty-cache", false); - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); do_test_pending(); } @@ -588,7 +588,7 @@ function* test_storage_cleared() do_check_eq(storage.getItem("test"), "value" + i); } - ForgetAboutSite.removeDataFromDomain("mozilla.org"); + yield ForgetAboutSite.removeDataFromDomain("mozilla.org"); yield waitForPurgeNotification(); do_check_eq(s[0].getItem("test"), null); |