Backed out changeset 5521f4a9012d (bug 1440578) for ESlint failure on browser/components/enterprisepolicies/Policies.jsm
authorCosmin Sabou <csabou@mozilla.com>
Thu, 08 Mar 2018 06:17:19 +0200
changeset 407111 b18dbffb418d
parent 407110 52d86f152c2d
child 407112 ea89e8713941
push id100579
push usercsabou@mozilla.com
push dateThu, 08 Mar 2018 04:18:16 +0000
treeherdermozilla-inbound@b18dbffb418d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1440578
milestone60.0a1
backs out5521f4a9012d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 5521f4a9012d (bug 1440578) for ESlint failure on browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/tests/browser/browser.ini
browser/components/enterprisepolicies/tests/browser/browser_policy_blocked_cookies.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -102,25 +102,16 @@ var Policies = {
     onAllWindowsRestored(manager, param) {
       BookmarksPolicies.processBookmarks(param);
     }
   },
 
   "Cookies": {
     onBeforeUIStartup(manager, param) {
       addAllowDenyPermissions("cookie", param.Allow, param.Block);
-
-      if (param.Block) {
-        const hosts = param.Block.map(uri => uri.host).sort().join('\n');
-        runOncePerModification("clearCookiesForBlockedHosts", hosts, () => {
-          for (let blocked of param.Block) {
-            Services.cookies.removeCookiesWithOriginAttributes("{}", blocked.host);
-          }
-        });
-      }
     }
   },
 
   "CreateMasterPassword": {
     onBeforeUIStartup(manager, param) {
       if (!param) {
         manager.disallowFeature("createMasterPassword");
       }
--- a/browser/components/enterprisepolicies/tests/browser/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/browser.ini
@@ -16,17 +16,16 @@ support-files =
 [browser_policies_sorted_alphabetically.js]
 [browser_policies_validate_and_parse_API.js]
 [browser_policy_app_update.js]
 [browser_policy_block_about_addons.js]
 [browser_policy_block_about_config.js]
 [browser_policy_block_about_profiles.js]
 [browser_policy_block_about_support.js]
 [browser_policy_block_set_desktop_background.js]
-[browser_policy_blocked_cookies.js]
 [browser_policy_bookmarks.js]
 [browser_policy_default_browser_check.js]
 [browser_policy_disable_formhistory.js]
 [browser_policy_disable_fxaccounts.js]
 [browser_policy_disable_fxscreenshots.js]
 [browser_policy_disable_masterpassword.js]
 [browser_policy_disable_pocket.js]
 [browser_policy_disable_privatebrowsing.js]
deleted file mode 100644
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_blocked_cookies.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-
-add_task(async function setup() {
-  const expiry = Date.now() + 24 * 60 * 60;
-  Services.cookies.add("example.com", "/", "secure", "true", true, false, false, expiry, {});
-  Services.cookies.add("example.com", "/", "insecure", "true", false, false, false, expiry, {});
-  Services.cookies.add("example.org", "/", "secure", "true", true, false, false, expiry, {});
-  Services.cookies.add("example.org", "/", "insecure", "true", false, false, false, expiry, {});
-  Services.cookies.add("example.net", "/", "secure", "true", true, false, false, expiry, {});
-  await setupPolicyEngineWithJson({
-    "policies": {
-      "Cookies": {
-        "Block": [
-          "http://example.com",
-          "https://example.org:8080"
-        ]
-      }
-    }
-  });
-});
-
-function retrieve_all_cookies(host) {
-  const values = [];
-  const cookies = Services.cookies.getCookiesFromHost(host, {});
-  while (cookies.hasMoreElements()) {
-    const cookie = cookies.getNext().QueryInterface(Ci.nsICookie);
-    values.push({
-      host: cookie.host,
-      name: cookie.name,
-      path: cookie.path
-    });
-  }
-  return values;
-}
-
-add_task(async function test_cookies_for_blocked_sites_cleared() {
-  const cookies = {
-    hostname: retrieve_all_cookies("example.com"),
-    origin: retrieve_all_cookies("example.org"),
-    keep: retrieve_all_cookies("example.net")
-  };
-  const expected = {
-    hostname: [],
-    origin: [],
-    keep: [
-      {host: "example.net",
-       name: "secure",
-       path: "/"}
-    ]
-  };
-  is(JSON.stringify(cookies), JSON.stringify(expected),
-     "All stored cookies for blocked hosts should be cleared");
-});
-
-add_task(function teardown() {
-  for (let host of ["example.com", "example.org", "example.net"]) {
-    Services.cookies.removeCookiesWithOriginAttributes("{}", host);
-  }
-});
\ No newline at end of file