summaryrefslogtreecommitdiffstats
path: root/chromeos/test
diff options
context:
space:
mode:
authorpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 19:35:00 +0000
committerpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 19:35:00 +0000
commit4d049450f2cd8b761aab4b1c5bdd7a497178d2db (patch)
tree8476e1d93aa4d5f13ea6d0e71a06cfe22f9c022c /chromeos/test
parent988e6588de319fd5a3329f204659bd634b1238bb (diff)
downloadchromium_src-4d049450f2cd8b761aab4b1c5bdd7a497178d2db.zip
chromium_src-4d049450f2cd8b761aab4b1c5bdd7a497178d2db.tar.gz
chromium_src-4d049450f2cd8b761aab4b1c5bdd7a497178d2db.tar.bz2
Add configuration normalization to ManagedNetworkConfigurationHandler.
Compared to legacy NetworkLibrary::LoadOncNetworks, ManagedNetworkConfigurationHandler didn't normalize (e.g. remove redundant properties) configurations before sending them to Shill. This commit - adds this normalization - changes the policy application behavior: it's safer to remove network profile entries before a new policy (new GUID) is applied. - splits definition and declaration of ManagedNetworkConfigurationHandler::PolicyApplicator - adds more unit tests BUG=261152 Review URL: https://chromiumcodereview.appspot.com/19518005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/test')
-rw-r--r--chromeos/test/data/network/policy/policy_wifi1_with_redundant_fields.onc25
-rw-r--r--chromeos/test/data/network/policy/shill_policy_on_unmanaged_user_wifi1_wo_uidata.json10
-rw-r--r--chromeos/test/data/network/policy/shill_unmanaged_user_wifi1_wo_uidata.json9
3 files changed, 44 insertions, 0 deletions
diff --git a/chromeos/test/data/network/policy/policy_wifi1_with_redundant_fields.onc b/chromeos/test/data/network/policy/policy_wifi1_with_redundant_fields.onc
new file mode 100644
index 0000000..10677ec
--- /dev/null
+++ b/chromeos/test/data/network/policy/policy_wifi1_with_redundant_fields.onc
@@ -0,0 +1,25 @@
+{
+ "NetworkConfigurations": [
+ {
+ "GUID": "policy_wifi1",
+ "Type": "WiFi",
+ "Name": "Managed wifi1",
+ "WiFi": {
+ "Passphrase": "policy's passphrase",
+ "Recommended": [ "AutoConnect", "Passphrase" ],
+ "SSID": "wifi1",
+ "Security": "WPA-PSK",
+ "EAP": {
+ "Outer": "PEAP",
+ "UseSystemCAs": false,
+ "Recommended": [
+ "AnonymousIdentity",
+ "Identity",
+ "Password"
+ ]
+ }
+ }
+ }
+ ],
+ "Type": "UnencryptedConfiguration"
+}
diff --git a/chromeos/test/data/network/policy/shill_policy_on_unmanaged_user_wifi1_wo_uidata.json b/chromeos/test/data/network/policy/shill_policy_on_unmanaged_user_wifi1_wo_uidata.json
new file mode 100644
index 0000000..d2c959e
--- /dev/null
+++ b/chromeos/test/data/network/policy/shill_policy_on_unmanaged_user_wifi1_wo_uidata.json
@@ -0,0 +1,10 @@
+{
+ "GUID": "policy_wifi1",
+ "Mode": "managed",
+ "Passphrase": "user's passphrase",
+ "Profile": "/profile/user1/shill",
+ "SSID": "wifi1",
+ "Security": "psk",
+ "Type": "wifi",
+ "UIData": "{\"onc_source\":\"user_policy\"}}"
+}
diff --git a/chromeos/test/data/network/policy/shill_unmanaged_user_wifi1_wo_uidata.json b/chromeos/test/data/network/policy/shill_unmanaged_user_wifi1_wo_uidata.json
new file mode 100644
index 0000000..ac7fb73
--- /dev/null
+++ b/chromeos/test/data/network/policy/shill_unmanaged_user_wifi1_wo_uidata.json
@@ -0,0 +1,9 @@
+{
+ "GUID": "{unmanaged_user_wifi1}",
+ "Mode": "managed",
+ "Passphrase": "user's passphrase",
+ "Profile": "/profile/chronos/shill",
+ "SSID": "wifi1",
+ "Security": "psk",
+ "Type": "wifi",
+}