Commit e7912ae2 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

CrOS Network: Disable IP Config for Cellular

Static IP configuration for Cellular networks does not work and can
only break things.

Bug: 993587
Change-Id: I734c25ccabd5330134aa59be9eea04f3dc6ad0a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495704
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820463}
parent b68715b5
...@@ -19,6 +19,33 @@ suite('NetworkIpConfigTest', function() { ...@@ -19,6 +19,33 @@ suite('NetworkIpConfigTest', function() {
Polymer.dom.flush(); Polymer.dom.flush();
}); });
test('Enabled', function() {
const mojom = chromeos.networkConfig.mojom;
assertTrue(!!ipConfig.$.autoConfigIpToggle);
// WiFi non-policy networks should enable autoConfigIpToggle.
ipConfig.managedProperties = {
ipAddressConfigType: {
activeValue: 'Static',
policySource: mojom.PolicySource.kNone,
},
type: mojom.NetworkType.kWiFi,
};
Polymer.dom.flush();
assertFalse(ipConfig.$.autoConfigIpToggle.disabled);
// Cellular network should disable autoConfigIpToggle.
ipConfig.managedProperties = {
ipAddressConfigType: {
activeValue: 'Static',
policySource: mojom.PolicySource.kNone,
},
type: mojom.NetworkType.kCellular,
};
Polymer.dom.flush();
assertTrue(ipConfig.$.autoConfigIpToggle.disabled);
});
test('Auto-config toggle policy enforcement', function() { test('Auto-config toggle policy enforcement', function() {
const mojom = chromeos.networkConfig.mojom; const mojom = chromeos.networkConfig.mojom;
...@@ -34,7 +61,7 @@ suite('NetworkIpConfigTest', function() { ...@@ -34,7 +61,7 @@ suite('NetworkIpConfigTest', function() {
// ipAddressConfigType policy is not enforced (kNone). // ipAddressConfigType policy is not enforced (kNone).
ipConfig.managedProperties = { ipConfig.managedProperties = {
ipAddressConfigType: { ipAddressConfigType: {
activeValue: "Static", activeValue: 'Static',
policySource: mojom.PolicySource.kNone, policySource: mojom.PolicySource.kNone,
}, },
}; };
...@@ -44,7 +71,7 @@ suite('NetworkIpConfigTest', function() { ...@@ -44,7 +71,7 @@ suite('NetworkIpConfigTest', function() {
// ipAddressConfigType policy is enforced. // ipAddressConfigType policy is enforced.
ipConfig.managedProperties = { ipConfig.managedProperties = {
ipAddressConfigType: { ipAddressConfigType: {
activeValue: "Static", activeValue: 'Static',
policySource: mojom.PolicySource.kUserPolicyEnforced, policySource: mojom.PolicySource.kUserPolicyEnforced,
}, },
}; };
......
...@@ -197,6 +197,11 @@ Polymer({ ...@@ -197,6 +197,11 @@ Polymer({
* @private * @private
*/ */
canChangeIPConfigType_(managedProperties) { canChangeIPConfigType_(managedProperties) {
if (managedProperties.type ===
chromeos.networkConfig.mojom.NetworkType.kCellular) {
// Cellular IP config properties can not be changed.
return false;
}
const ipConfigType = managedProperties.ipAddressConfigType; const ipConfigType = managedProperties.ipAddressConfigType;
return !ipConfigType || !this.isNetworkPolicyEnforced(ipConfigType); return !ipConfigType || !this.isNetworkPolicyEnforced(ipConfigType);
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment