Bug 1046430 - Make cookie behavior the same on beta/release as on aurora/nightly. r=jdm, a=lsblakk
authorMonica Chew <mmc@mozilla.com>
Thu, 02 Oct 2014 15:49:26 -0700
changeset 233893 8e9cc4b2f923da6a0a6c3e8aafaf629607c39fb0
parent 233892 95f5b36e1c44b76ae01fa4b1f32178e73b1910d5
child 233894 4ae20fe9a96e07608742df7ed4eb32cc2212f19f
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, lsblakk
bugs1046430
milestone35.0a2
Bug 1046430 - Make cookie behavior the same on beta/release as on aurora/nightly. r=jdm, a=lsblakk
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/tests/browser_privacypane_4.js
browser/components/preferences/privacy.js
browser/components/preferences/tests/browser_privacypane_4.js
modules/libpref/init/all.js
testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -214,23 +214,18 @@ var gPrivacyPane = {
       // select the remember history option if needed
       let rememberHistoryCheckbox = document.getElementById("rememberHistory");
       if (!rememberHistoryCheckbox.checked)
         rememberHistoryCheckbox.checked = true;
 
       // select the remember forms history option
       document.getElementById("browser.formfill.enable").value = true;
 
-#ifdef RELEASE_BUILD
       // select the allow cookies option
       document.getElementById("network.cookie.cookieBehavior").value = 0;
-#else
-      // select the limit cookies option
-      document.getElementById("network.cookie.cookieBehavior").value = 3;
-#endif
       // select the cookie lifetime policy option
       document.getElementById("network.cookie.lifetimePolicy").value = 0;
 
       // select the clear on close option
       document.getElementById("privacy.sanitize.sanitizeOnShutdown").value = false;
       break;
     case "dontremember":
       if (!pref.value)
@@ -440,29 +435,21 @@ var gPrivacyPane = {
    * Enables/disables the "keep until" label and menulist in response to the
    * "accept cookies" checkbox being checked or unchecked.
    */
   writeAcceptCookies: function ()
   {
     var accept = document.getElementById("acceptCookies");
     var acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
 
-#ifdef RELEASE_BUILD
     // if we're enabling cookies, automatically select 'accept third party always'
     if (accept.checked)
       acceptThirdPartyMenu.selectedIndex = 0;
 
     return accept.checked ? 0 : 2;
-#else
-    // if we're enabling cookies, automatically select 'accept third party from visited'
-    if (accept.checked)
-      acceptThirdPartyMenu.selectedIndex = 1;
-
-    return accept.checked ? 3 : 2;
-#endif
   },
   
   /**
    * Converts between network.cookie.cookieBehavior and the third-party cookie UI
    */
   readAcceptThirdPartyCookies: function ()
   {
     var pref = document.getElementById("network.cookie.cookieBehavior");
--- a/browser/components/preferences/in-content/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
@@ -12,24 +12,20 @@ function test() {
   }
   loader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
   let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
 
   run_test_subset(Array.concat([
     test_custom_retention("acceptCookies", "remember"),
     test_custom_retention("acceptCookies", "custom")
   ],
-    (runtime.isReleaseBuild ? [
+    [
     test_custom_retention("acceptThirdPartyMenu", "remember", "visited"),
     test_custom_retention("acceptThirdPartyMenu", "custom", "always")
-    ]
-    : [
-    test_custom_retention("acceptThirdPartyMenu", "remember", "always"),
-    test_custom_retention("acceptThirdPartyMenu", "custom", "visited")
-    ]), [
+    ], [
     test_custom_retention("keepCookiesUntil", "remember", 1),
     test_custom_retention("keepCookiesUntil", "custom", 2),
     test_custom_retention("keepCookiesUntil", "custom", 0),
     test_custom_retention("alwaysClear", "remember"),
     test_custom_retention("alwaysClear", "custom"),
     test_historymode_retention("remember", "remember"),
 
     // reset all preferences to their default values once we're done
--- a/browser/components/preferences/privacy.js
+++ b/browser/components/preferences/privacy.js
@@ -175,23 +175,18 @@ var gPrivacyPane = {
       // select the remember history option if needed
       let rememberHistoryCheckbox = document.getElementById("rememberHistory");
       if (!rememberHistoryCheckbox.checked)
         rememberHistoryCheckbox.checked = true;
 
       // select the remember forms history option
       document.getElementById("browser.formfill.enable").value = true;
 
-#ifdef RELEASE_BUILD
       // select the accept cookies option
       document.getElementById("network.cookie.cookieBehavior").value = 0;
-#else
-      // select the limit cookies option
-      document.getElementById("network.cookie.cookieBehavior").value = 3;
-#endif
       // select the cookie lifetime policy option
       document.getElementById("network.cookie.lifetimePolicy").value = 0;
 
       // select the clear on close option
       document.getElementById("privacy.sanitize.sanitizeOnShutdown").value = false;
       break;
     case "dontremember":
       if (!pref.value)
@@ -402,29 +397,21 @@ var gPrivacyPane = {
    * Enables/disables the "keep until" label and menulist in response to the
    * "accept cookies" checkbox being checked or unchecked.
    */
   writeAcceptCookies: function ()
   {
     var accept = document.getElementById("acceptCookies");
     var acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
 
-#ifdef RELEASE_BUILD
     // if we're enabling cookies, automatically select 'accept third party always'
     if (accept.checked)
       acceptThirdPartyMenu.selectedIndex = 0;
 
     return accept.checked ? 0 : 2;
-#else
-    // if we're enabling cookies, automatically select 'accept third party from visited'
-    if (accept.checked)
-      acceptThirdPartyMenu.selectedIndex = 1;
-
-    return accept.checked ? 3 : 2;
-#endif
   },
 
   /**
    * Converts between network.cookie.cookieBehavior and the third-party cookie UI
    */
   readAcceptThirdPartyCookies: function ()
   {
     var pref = document.getElementById("network.cookie.cookieBehavior");
--- a/browser/components/preferences/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/tests/browser_privacypane_4.js
@@ -13,24 +13,20 @@ function test() {
   }
   loader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
   let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
 
   run_test_subset(Array.concat([
     test_custom_retention("acceptCookies", "remember"),
     test_custom_retention("acceptCookies", "custom")
     ],
-    (runtime.isReleaseBuild ? [
+    [
     test_custom_retention("acceptThirdPartyMenu", "remember", "visited"),
     test_custom_retention("acceptThirdPartyMenu", "custom", "always")
-    ]
-    : [
-    test_custom_retention("acceptThirdPartyMenu", "remember", "always"),
-    test_custom_retention("acceptThirdPartyMenu", "custom", "visited")
-    ]), [
+    ], [
     test_custom_retention("keepCookiesUntil", "remember", 1),
     test_custom_retention("keepCookiesUntil", "custom", 2),
     test_custom_retention("keepCookiesUntil", "custom", 0),
     test_custom_retention("alwaysClear", "remember"),
     test_custom_retention("alwaysClear", "custom"),
     test_historymode_retention("remember", "remember"),
 
     // reset all preferences to their default values once we're done
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1625,21 +1625,17 @@ pref("network.proxy.ssl_port",          
 pref("network.proxy.socks",                 "");
 pref("network.proxy.socks_port",            0);
 pref("network.proxy.socks_version",         5);
 pref("network.proxy.socks_remote_dns",      false);
 pref("network.proxy.proxy_over_tls",        true);
 pref("network.proxy.no_proxies_on",         "localhost, 127.0.0.1");
 pref("network.proxy.failover_timeout",      1800); // 30 minutes
 pref("network.online",                      true); //online/offline
-#ifdef RELEASE_BUILD
 pref("network.cookie.cookieBehavior",       0); // 0-Accept, 1-dontAcceptForeign, 2-dontUse, 3-limitForeign
-#else
-pref("network.cookie.cookieBehavior",       3); // 0-Accept, 1-dontAcceptForeign, 2-dontUse, 3-limitForeign
-#endif
 #ifdef ANDROID
 pref("network.cookie.cookieBehavior",       0); // Keep the old default of accepting all cookies
 #endif
 pref("network.cookie.thirdparty.sessionOnly", false);
 pref("network.cookie.lifetimePolicy",       0); // accept normally, 1-askBeforeAccepting, 2-acceptForSession,3-acceptForNDays
 pref("network.cookie.alwaysAcceptSessionCookies", false);
 pref("network.cookie.prefsMigrated",        false);
 pref("network.cookie.lifetime.days",        90);
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini
@@ -0,0 +1,4 @@
+[document-cookie.html]
+  type: testharness
+  [getting cookie for a cookie-averse document returns empty string, setting does nothing]
+    expected: FAIL