Bug 1503393 - Make 'no proxy' field editable. r=jaws, a=RyanVM
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 03 Dec 2018 16:27:50 +0200
changeset 509076 b380a84b065d4afbb7d42a229616afcbd7c4ff9c
parent 509075 005811564dc5e60f72bd43ca09408d9b01968d90
child 509077 794b2e929584de6e99cd5a0b971c1202d42b8ab8
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)
reviewersjaws, RyanVM
bugs1503393
milestone65.0
Bug 1503393 - Make 'no proxy' field editable. r=jaws, a=RyanVM
browser/components/preferences/connection.js
browser/components/preferences/in-content/tests/browser_extension_controlled.js
--- a/browser/components/preferences/connection.js
+++ b/browser/components/preferences/connection.js
@@ -123,17 +123,17 @@ var gConnectionsDialog = {
     // Now update the other protocols
     this.updateProtocolPrefs();
 
     var shareProxiesPref = Preferences.get("network.proxy.share_proxy_settings");
     shareProxiesPref.disabled = proxyTypePref.value != 1;
     var autologinProxyPref = Preferences.get("signon.autologin.proxy");
     autologinProxyPref.disabled = proxyTypePref.value == 0;
     var noProxiesPref = Preferences.get("network.proxy.no_proxies_on");
-    noProxiesPref.disabled = proxyTypePref.value != 1;
+    noProxiesPref.disabled = proxyTypePref.value == 0;
 
     var autoconfigURLPref = Preferences.get("network.proxy.autoconfig_url");
     autoconfigURLPref.disabled = proxyTypePref.value != 2;
 
     this.updateReloadButton();
   },
 
   updateDNSPref() {
--- a/browser/components/preferences/in-content/tests/browser_extension_controlled.js
+++ b/browser/components/preferences/in-content/tests/browser_extension_controlled.js
@@ -745,38 +745,40 @@ add_task(async function testExtensionCon
           },
         }, "The user is notified that an extension is controlling proxy settings.");
       }
       function getProxyControls() {
         let controlGroup = doc.getElementById("networkProxyType");
         let manualControlContainer = controlGroup.querySelector("grid");
         return {
           manualControls: [
-            ...manualControlContainer.querySelectorAll("label"),
-            ...manualControlContainer.querySelectorAll("textbox"),
+            ...manualControlContainer.querySelectorAll("label:not([control=networkProxyNone])"),
+            ...manualControlContainer.querySelectorAll("textbox:not(#networkProxyNone)"),
             ...manualControlContainer.querySelectorAll("checkbox"),
             ...doc.querySelectorAll("#networkProxySOCKSVersion > radio")],
           pacControls: [doc.getElementById("networkProxyAutoconfigURL")],
           otherControls: [
+            manualControlContainer.querySelector("label[control=networkProxyNone]"),
+            doc.getElementById("networkProxyNone"),
             ...controlGroup.querySelectorAll(":scope > radio"),
             ...doc.querySelectorAll("#ConnectionsDialogPane > checkbox")],
         };
       }
       let controlState = isControlled ? "disabled" : "enabled";
       let controls = getProxyControls();
       for (let element of controls.manualControls) {
         let disabled = isControlled || proxyType !== proxySvc.PROXYCONFIG_MANUAL;
-        is(element.disabled, disabled, `Proxy controls are ${controlState}.`);
+        is(element.disabled, disabled, `Manual proxy controls should be ${controlState} - control: ${element.outerHTML}.`);
       }
       for (let element of controls.pacControls) {
         let disabled = isControlled || proxyType !== proxySvc.PROXYCONFIG_PAC;
-        is(element.disabled, disabled, `Proxy controls are ${controlState}.`);
+        is(element.disabled, disabled, `PAC proxy controls should be ${controlState} - control: ${element.outerHTML}.`);
       }
       for (let element of controls.otherControls) {
-        is(element.disabled, isControlled, `Proxy controls are ${controlState}.`);
+        is(element.disabled, isControlled, `Other proxy controls should be ${controlState} - control: ${element.outerHTML}.`);
       }
     } else {
       let elem = doc.getElementById(CONNECTION_SETTINGS_DESC_ID);
       is(doc.l10n.getAttributes(elem).id,
         expectedConnectionSettingsMessage(doc, isControlled),
         "The connection settings description is as expected.");
     }
   }