bug 1503393 - adjust tests for localhost proxying r=mayhemer
☠☠ backed out by 7670b6ce33a4 ☠ ☠
authorDaniel Stenberg <daniel@haxx.se>
Mon, 03 Dec 2018 16:28:14 +0200
changeset 508457 52e8ef71af9b837be53b294d09381d70c5efceba
parent 508456 7878029aaba609b5433d3eea98873a450cf2cb62
child 508458 7670b6ce33a4b3ad15ff3dc1ec3bfb9349cec19b
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1503393
milestone65.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 1503393 - adjust tests for localhost proxying r=mayhemer Fix test_proxy-failover_canceled and browser_firstPartyIsolation
browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
netwerk/test/unit/test_proxy-failover_canceled.js
--- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
+++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
@@ -282,16 +282,21 @@ add_task(async function window_open_form
 
 /**
  * A test for using an IP address as the first party domain.
  */
 add_task(async function ip_address_test() {
   const ipAddr = "127.0.0.1";
   const ipHost = `http://${ipAddr}/browser/browser/components/originattributes/test/browser/`;
 
+  Services.prefs.setCharPref("network.proxy.no_proxies_on", "");
+  registerCleanupFunction(function() {
+    Services.prefs.clearUserPref("network.proxy.no_proxies_on");
+  });
+
   let tab = BrowserTestUtils.addTab(gBrowser, ipHost + "test_firstParty.html");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser, true);
 
   await ContentTask.spawn(tab.linkedBrowser, { firstPartyDomain: ipAddr }, async function(attrs) {
     info("document principal: " + content.document.nodePrincipal.origin);
     Assert.equal(content.document.nodePrincipal.originAttributes.firstPartyDomain,
                    attrs.firstPartyDomain, "The firstPartyDomain should be set properly for the IP address");
   });
--- a/netwerk/test/unit/test_proxy-failover_canceled.js
+++ b/netwerk/test/unit/test_proxy-failover_canceled.js
@@ -34,17 +34,18 @@ function run_test()
   // redirects from now.
 
   var nc = new ChannelEventSink();
   nc._flags = ES_ABORT_REDIRECT;
 
   var prefserv = Cc["@mozilla.org/preferences-service;1"].
                  getService(Ci.nsIPrefService);
   var prefs = prefserv.getBranch("network.proxy.");
-  prefs.setIntPref("type", 2);
+    prefs.setIntPref("type", 2);
+    prefs.setCharPref("no_proxies_on", "nothing");
   prefs.setCharPref("autoconfig_url", "data:text/plain," +
     "function FindProxyForURL(url, host) {return 'PROXY a_non_existent_domain_x7x6c572v:80; PROXY localhost:" +
     httpServer.identity.primaryPort + "';}"
   );
 
   var chan = make_channel("http://localhost:" +
                           httpServer.identity.primaryPort + "/content");
   chan.notificationCallbacks = nc;