Bug 1385166 - disable rcwn in those web request tests causing bustage, r=mixedpuppy
authorJunior Hsu <juhsu@mozilla.com>
Thu, 27 Jul 2017 20:46:00 +0200
changeset 420411 e956fb49c3019b5ea1c1dd628d891bd374c9da88
parent 420410 9a61373374162e4698536f95c2245834a1c7b098
child 420412 43a17f4d5399bcca8f67b3756aadf670792873d2
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1385166
milestone56.0a1
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
Bug 1385166 - disable rcwn in those web request tests causing bustage, r=mixedpuppy
toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
toolkit/modules/tests/browser/browser_WebRequest_filtering.js
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
@@ -54,17 +54,18 @@ add_task(async function setup() {
 
 add_task(async function test_webRequest_filter_window() {
   if (AppConstants.MOZ_BUILD_APP !== "browser") {
     // Android does not support multiple windows.
     return;
   }
 
   await SpecialPowers.pushPrefEnv({
-    set: [["dom.serviceWorkers.testing.enabled", true]],
+    set: [["dom.serviceWorkers.testing.enabled", true],
+          ["network.http.rcwn.enabled", false]],
   });
 
   let events = {
     "onBeforeRequest":     [{urls: ["<all_urls>"], windowId: windowData.windowId}],
     "onBeforeSendHeaders": [{urls: ["<all_urls>"], windowId: windowData.windowId}, ["requestHeaders"]],
     "onSendHeaders":       [{urls: ["<all_urls>"], windowId: windowData.windowId}, ["requestHeaders"]],
     "onBeforeRedirect":    [{urls: ["<all_urls>"], windowId: windowData.windowId}],
     "onHeadersReceived":   [{urls: ["<all_urls>"], windowId: windowData.windowId}, ["responseHeaders"]],
--- a/toolkit/modules/tests/browser/browser_WebRequest_filtering.js
+++ b/toolkit/modules/tests/browser/browser_WebRequest_filtering.js
@@ -105,8 +105,16 @@ add_task(async function filter_types() {
 
 function waitForLoad(browser = gBrowser.selectedBrowser) {
   return new Promise(resolve => {
     browser.addEventListener("load", function() {
       resolve();
     }, {capture: true, once: true});
   });
 }
+
+// Disable rcwn to make cache behavior deterministic.
+let rcwnEnabled = Preferences.get("network.http.rcwn.enabled");
+Preferences.set("network.http.rcwn.enabled", false);
+
+registerCleanupFunction(() => {
+  Preferences.set("network.http.rcwn.enabled", rcwnEnabled);
+});