diff --git a/browser/components/originattributes/test/browser/browser_cache.js b/browser/components/originattributes/test/browser/browser_cache.js index f1d380cd31fa..9acb0743ad74 100644 --- a/browser/components/originattributes/test/browser/browser_cache.js +++ b/browser/components/originattributes/test/browser/browser_cache.js @@ -151,6 +151,7 @@ async function doInit(aMode) { set: [ ["network.predictor.enabled", false], ["network.predictor.enable-prefetch", false], + ["browser.cache.cache_isolation", false], ], }); clearAllImageCaches(); diff --git a/browser/components/originattributes/test/browser/browser_imageCacheIsolation.js b/browser/components/originattributes/test/browser/browser_imageCacheIsolation.js index 89bb6f214a59..3c107ac465b1 100644 --- a/browser/components/originattributes/test/browser/browser_imageCacheIsolation.js +++ b/browser/components/originattributes/test/browser/browser_imageCacheIsolation.js @@ -19,6 +19,8 @@ server.start(-1); // Disable rcwn to make cache behavior deterministic. let rcwnEnabled = Services.prefs.getBoolPref("network.http.rcwn.enabled"); Services.prefs.setBoolPref("network.http.rcwn.enabled", false); +// Disable additional Http cache isolation. +Services.prefs.setBoolPref("browser.cache.cache_isolation", false); registerCleanupFunction(() => { Services.prefs.setBoolPref("network.http.rcwn.enabled", rcwnEnabled); diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index cacbf5924885..4b7d0c006784 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -687,7 +687,12 @@ # Enable/Disable Origin based cache isolation - name: browser.cache.cache_isolation type: RelaxedAtomicBool + +#if defined(NIGHTLY_BUILD) + value: true +#else value: false +#endif mirror: always # -1 = determine dynamically, 0 = none, n = memory capacity in kilobytes. diff --git a/netwerk/test/browser/browser_about_cache.js b/netwerk/test/browser/browser_about_cache.js index 29bdea6fb822..a64f12e41585 100644 --- a/netwerk/test/browser/browser_about_cache.js +++ b/netwerk/test/browser/browser_about_cache.js @@ -4,6 +4,9 @@ * Open a dummy page, then open about:cache and verify the opened page shows up in the cache. */ add_task(async function() { + await SpecialPowers.pushPrefEnv({ + set: [["browser.cache.cache_isolation", false]], + }); const kRoot = getRootDirectory(gTestPath).replace( "chrome://mochitests/content/", "https://example.com/" diff --git a/netwerk/test/unit/test_alt-data_closeWithStatus.js b/netwerk/test/unit/test_alt-data_closeWithStatus.js index f8245e4f726f..2c14c6c5cc5c 100644 --- a/netwerk/test/unit/test_alt-data_closeWithStatus.js +++ b/netwerk/test/unit/test_alt-data_closeWithStatus.js @@ -11,6 +11,7 @@ */ const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js"); +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); XPCOMUtils.defineLazyGetter(this, "URL", function() { return "http://localhost:" + httpServer.identity.primaryPort + "/content"; @@ -79,6 +80,10 @@ function check_has_alt_data_in_index(aHasAltData) { } function run_test() { + if (!inChildProcess()) { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + } + do_get_profile(); httpServer = new HttpServer(); httpServer.registerPathHandler("/content", contentHandler); diff --git a/netwerk/test/unit/test_alt-data_simple.js b/netwerk/test/unit/test_alt-data_simple.js index 0d2788203188..ea88f8e33fa5 100644 --- a/netwerk/test/unit/test_alt-data_simple.js +++ b/netwerk/test/unit/test_alt-data_simple.js @@ -10,6 +10,7 @@ */ const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js"); +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); XPCOMUtils.defineLazyGetter(this, "URL", function() { return "http://localhost:" + httpServer.identity.primaryPort + "/content"; @@ -68,6 +69,9 @@ function check_has_alt_data_in_index(aHasAltData) { } function run_test() { + if (!inChildProcess()) { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + } do_get_profile(); httpServer = new HttpServer(); httpServer.registerPathHandler("/content", contentHandler); diff --git a/netwerk/test/unit/test_bug1064258.js b/netwerk/test/unit/test_bug1064258.js index 34d11977f072..817338e53744 100644 --- a/netwerk/test/unit/test_bug1064258.js +++ b/netwerk/test/unit/test_bug1064258.js @@ -53,6 +53,8 @@ function contentHandler2(metadata, response) { } function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + httpServer = new HttpServer(); httpServer.registerPathHandler("/content1", contentHandler1); httpServer.registerPathHandler("/content2", contentHandler2); diff --git a/netwerk/test/unit/test_bug482601.js b/netwerk/test/unit/test_bug482601.js index 8f5f9b6b782c..69f1f45737bf 100644 --- a/netwerk/test/unit/test_bug482601.js +++ b/netwerk/test/unit/test_bug482601.js @@ -37,6 +37,8 @@ var listener = { }; function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + httpserv = new HttpServer(); httpserv.registerPathHandler("/bug482601/nocache", bug482601_nocache); httpserv.registerPathHandler("/bug482601/partial", bug482601_partial); diff --git a/netwerk/test/unit/test_bug482934.js b/netwerk/test/unit/test_bug482934.js index e84584236ccc..7e36d86e52b9 100644 --- a/netwerk/test/unit/test_bug482934.js +++ b/netwerk/test/unit/test_bug482934.js @@ -9,7 +9,6 @@ var request_time; var response_time; var cache_storage; - var httpserver = new HttpServer(); httpserver.start(-1); @@ -69,6 +68,8 @@ function check_cached_data(aCachedData, aCallback) { } function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + do_get_profile(); evict_cache_entries(); diff --git a/netwerk/test/unit/test_bug618835.js b/netwerk/test/unit/test_bug618835.js index ad80e75a18f2..c5077aaaef4a 100644 --- a/netwerk/test/unit/test_bug618835.js +++ b/netwerk/test/unit/test_bug618835.js @@ -80,6 +80,8 @@ FinalListener.prototype = { }; function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); + httpserv = new HttpServer(); httpserv.registerPathHandler("/cl", content_location); httpserv.registerPathHandler("/post", post_target); diff --git a/netwerk/test/unit/test_bug812167.js b/netwerk/test/unit/test_bug812167.js index 5006158c3a38..04b40ced11ea 100644 --- a/netwerk/test/unit/test_bug812167.js +++ b/netwerk/test/unit/test_bug812167.js @@ -127,6 +127,7 @@ function finish_test() { function run_test() { do_get_profile(); + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); httpserver = new HttpServer(); httpserver.registerPathHandler(randomPath1, redirectHandler_NoStore); diff --git a/netwerk/test/unit/test_cache-control_request.js b/netwerk/test/unit/test_cache-control_request.js index a6180b50d62e..d0e3e6885b8f 100644 --- a/netwerk/test/unit/test_cache-control_request.js +++ b/netwerk/test/unit/test_cache-control_request.js @@ -79,6 +79,7 @@ function run_test() { do_test_pending(); Services.prefs.setBoolPref("network.http.rcwn.enabled", false); + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); httpserver.registerPathHandler(resource_age_100, resource_age_100_handler); httpserver.registerPathHandler( diff --git a/netwerk/test/unit/test_http2.js b/netwerk/test/unit/test_http2.js index 990a708bee2f..a612f26bb698 100644 --- a/netwerk/test/unit/test_http2.js +++ b/netwerk/test/unit/test_http2.js @@ -1407,6 +1407,7 @@ function run_test() { prefs.setBoolPref("network.http.spdy.enabled.http2", true); prefs.setBoolPref("network.http.altsvc.enabled", true); prefs.setBoolPref("network.http.altsvc.oe", true); + prefs.setBoolPref("browser.cache.cache_isolation", false); prefs.setCharPref( "network.dns.localDomains", "foo.example.com, bar.example.com" diff --git a/netwerk/test/unit/test_inhibit_caching.js b/netwerk/test/unit/test_inhibit_caching.js index 6b1e6531862a..47c9a696afec 100644 --- a/netwerk/test/unit/test_inhibit_caching.js +++ b/netwerk/test/unit/test_inhibit_caching.js @@ -19,6 +19,7 @@ var httpserver = null; function run_test() { // setup test + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); httpserver = new HttpServer(); httpserver.registerPathHandler("/test", contentHandler); httpserver.start(-1); diff --git a/netwerk/test/unit/test_predictor.js b/netwerk/test/unit/test_predictor.js index 9d21a6fd3267..309255e514ff 100644 --- a/netwerk/test/unit/test_predictor.js +++ b/netwerk/test/unit/test_predictor.js @@ -739,6 +739,7 @@ function run_test_real() { tests.forEach(f => add_test(f)); do_get_profile(); + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); Services.prefs.setBoolPref("network.predictor.enabled", true); Services.prefs.setBoolPref("network.predictor.cleaned-up", true); Services.prefs.setBoolPref("network.predictor.doing-tests", true); diff --git a/netwerk/test/unit/test_protocolproxyservice.js b/netwerk/test/unit/test_protocolproxyservice.js index ab8e58380336..6dc1cd6931b7 100644 --- a/netwerk/test/unit/test_protocolproxyservice.js +++ b/netwerk/test/unit/test_protocolproxyservice.js @@ -25,6 +25,8 @@ var pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(); var prefs = Cc["@mozilla.org/preferences-service;1"].getService( Ci.nsIPrefBranch ); +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +Services.prefs.setBoolPref("browser.cache.cache_isolation", false); /** * Test nsIProtocolHandler that allows proxying, but doesn't allow HTTP diff --git a/netwerk/test/unit/test_suspend_channel_on_examine_merged_response.js b/netwerk/test/unit/test_suspend_channel_on_examine_merged_response.js index 7228b7b6850c..c4d902948df6 100644 --- a/netwerk/test/unit/test_suspend_channel_on_examine_merged_response.js +++ b/netwerk/test/unit/test_suspend_channel_on_examine_merged_response.js @@ -55,6 +55,7 @@ var listener = { }; function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); httpserv = new HttpServer(); httpserv.registerPathHandler("/path/partial", path_partial); httpserv.registerPathHandler("/path/cached", path_cached); diff --git a/netwerk/test/unit_ipc/test_alt-data_closeWithStatus_wrap.js b/netwerk/test/unit_ipc/test_alt-data_closeWithStatus_wrap.js index d2beb0fa17c0..fdf48ecbc975 100644 --- a/netwerk/test/unit_ipc/test_alt-data_closeWithStatus_wrap.js +++ b/netwerk/test/unit_ipc/test_alt-data_closeWithStatus_wrap.js @@ -11,6 +11,7 @@ var cacheFlushObserver = { var currentThread = Services.tm.currentThread; function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); do_get_profile(); do_await_remote_message("flush").then(() => { Services.cache2 diff --git a/netwerk/test/unit_ipc/test_alt-data_simple_wrap.js b/netwerk/test/unit_ipc/test_alt-data_simple_wrap.js index 06f51785139c..f2f0690db9de 100644 --- a/netwerk/test/unit_ipc/test_alt-data_simple_wrap.js +++ b/netwerk/test/unit_ipc/test_alt-data_simple_wrap.js @@ -9,6 +9,7 @@ var cacheFlushObserver = { }; function run_test() { + Services.prefs.setBoolPref("browser.cache.cache_isolation", false); do_get_profile(); do_await_remote_message("flush").then(() => { Services.cache2 diff --git a/testing/web-platform/meta/fetch/http-cache/invalidate.html.ini b/testing/web-platform/meta/fetch/http-cache/invalidate.html.ini index d203e090672a..a74a80459c10 100644 --- a/testing/web-platform/meta/fetch/http-cache/invalidate.html.ini +++ b/testing/web-platform/meta/fetch/http-cache/invalidate.html.ini @@ -1,4 +1,5 @@ [invalidate.html] + prefs: [browser.cache.cache_isolation:false] [HTTP cache does not invalidate after a failed response from an unsafe request] expected: FAIL diff --git a/toolkit/components/antitracking/test/browser/browser_networkIsolation.js b/toolkit/components/antitracking/test/browser/browser_networkIsolation.js index 4e24bcc5f0d6..c7efecabd9f8 100644 --- a/toolkit/components/antitracking/test/browser/browser_networkIsolation.js +++ b/toolkit/components/antitracking/test/browser/browser_networkIsolation.js @@ -37,6 +37,7 @@ add_task(async function() { set: [ ["browser.cache.disk.enable", false], ["browser.cache.memory.enable", false], + ["browser.cache.cache_isolation", false], [ "network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,