Bug 1397306 - Empty noProxy list should reset no proxy exclusions. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 07 Sep 2017 10:21:36 +0200
changeset 428959 6e5e7386357e47cc38d7e4f8428e08b6efdeda7a
parent 428958 4c75e29bdb1b4efc58dde5e0161c3334fd780125
child 428960 47da53b3d3e7de7c69354566c69f81874fcb4990
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1397306
milestone57.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 1397306 - Empty noProxy list should reset no proxy exclusions. r=ato To allow resetting the default no proxy exclusion entries in Firefox tests have to pass an empty noProxy list. This should also be correctly applied. MozReview-Commit-ID: ABmYdPvoSvx
testing/marionette/session.js
testing/marionette/test_session.js
--- a/testing/marionette/session.js
+++ b/testing/marionette/session.js
@@ -170,17 +170,17 @@ session.Proxy = class {
           if (Number.isInteger(this.socksProxyPort)) {
             Preferences.set("network.proxy.socks_port", this.socksProxyPort);
           }
           if (this.socksVersion) {
             Preferences.set("network.proxy.socks_version", this.socksVersion);
           }
         }
 
-        if (this.noProxy && this.noProxy.length > 0) {
+        if (this.noProxy) {
           Preferences.set("network.proxy.no_proxies_on", this.noProxy.join(", "));
         }
         return true;
 
       case "pac":
         Preferences.set("network.proxy.type", 2);
         Preferences.set(
             "network.proxy.autoconfig_url", this.proxyAutoconfigUrl);
--- a/testing/marionette/test_session.js
+++ b/testing/marionette/test_session.js
@@ -162,16 +162,23 @@ add_test(function test_Proxy_init() {
     equal(Preferences.get("network.proxy.no_proxies_on"), "foo, bar");
     equal(Preferences.get(`network.proxy.${proxy}`), "foo");
     equal(Preferences.get(`network.proxy.${proxy}_port`), 42);
     if (proxy === "socks") {
       equal(Preferences.get(`network.proxy.${proxy}_version`), 4);
     }
   }
 
+  // empty no proxy should reset default exclustions
+  p = new session.Proxy();
+  p.proxyType = "manual";
+  p.noProxy = [];
+  ok(p.init());
+  equal(Preferences.get("network.proxy.no_proxies_on"), "");
+
   run_next_test();
 });
 
 add_test(function test_Proxy_toString() {
   equal(new session.Proxy().toString(), "[object session.Proxy]");
 
   run_next_test();
 });