Bug 1397306 - Empty noProxy list should reset no proxy exclusions.
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
--- 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();
});