| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The expectations in this test for the Chrome OS implementation. See | 5 // The expectations in this test for the Chrome OS implementation. See |
| 6 // networking_private_chromeos_apitest.cc for more info. | 6 // networking_private_chromeos_apitest.cc for more info. |
| 7 | 7 |
| 8 var callbackPass = chrome.test.callbackPass; | 8 var callbackPass = chrome.test.callbackPass; |
| 9 var callbackFail = chrome.test.callbackFail; | 9 var callbackFail = chrome.test.callbackFail; |
| 10 var assertTrue = chrome.test.assertTrue; | 10 var assertTrue = chrome.test.assertTrue; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 assertFalse(guid == 'ignored_guid'); | 171 assertFalse(guid == 'ignored_guid'); |
| 172 chrome.networkingPrivate.getProperties( | 172 chrome.networkingPrivate.getProperties( |
| 173 guid, callbackPass(function(properties) { | 173 guid, callbackPass(function(properties) { |
| 174 assertEq(NetworkType.WI_FI, properties.Type); | 174 assertEq(NetworkType.WI_FI, properties.Type); |
| 175 assertEq(guid, properties.GUID); | 175 assertEq(guid, properties.GUID); |
| 176 assertEq('wifi_created', properties.WiFi.SSID); | 176 assertEq('wifi_created', properties.WiFi.SSID); |
| 177 assertEq('WEP-PSK', properties.WiFi.Security); | 177 assertEq('WEP-PSK', properties.WiFi.Security); |
| 178 })); | 178 })); |
| 179 })); | 179 })); |
| 180 }, | 180 }, |
| 181 function createNetworkForPolicyControlledNetwork() { | |
| 182 chrome.networkingPrivate.getProperties('stub_wifi2', callbackPass(function( | |
| 183 properties) { | |
| 184 // Sanity check to verify there is a policy defined config for the network | |
| 185 // config that will be set up in this test. | |
| 186 chrome.test.assertEq('UserPolicy', properties.Source); | |
| 187 chrome.test.assertEq('WiFi', properties.Type); | |
| 188 chrome.test.assertEq('WPA-PSK', properties.WiFi.Security); | |
| 189 chrome.test.assertEq('wifi2_PSK', properties.WiFi.SSID); | |
| 190 | |
| 191 chrome.networkingPrivate.createNetwork(false /* shared */, { | |
| 192 Type: 'WiFi', | |
| 193 WiFi: { | |
| 194 SSID: 'wifi2_PSK', | |
| 195 Passphrase: 'Fake password', | |
| 196 Security: 'WPA-PSK' | |
| 197 } | |
| 198 }, callbackFail('NetworkAlreadyConfigured')); | |
| 199 })); | |
| 200 }, | |
| 201 function forgetNetwork() { | 181 function forgetNetwork() { |
| 202 var kNumNetworks = 2; | 182 var kNumNetworks = 2; |
| 203 var kTestNetworkGuid = 'stub_wifi1_guid'; | 183 var kTestNetworkGuid = 'stub_wifi1_guid'; |
| 204 function guidExists(networks, guid) { | 184 function guidExists(networks, guid) { |
| 205 for (var n of networks) { | 185 for (var n of networks) { |
| 206 if (n.GUID == kTestNetworkGuid) | 186 if (n.GUID == kTestNetworkGuid) |
| 207 return true; | 187 return true; |
| 208 } | 188 } |
| 209 return false; | 189 return false; |
| 210 } | 190 } |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 var tests = availableTests.filter(function(op) { | 889 var tests = availableTests.filter(function(op) { |
| 910 return args.test == op.name; | 890 return args.test == op.name; |
| 911 }); | 891 }); |
| 912 if (tests.length !== 1) { | 892 if (tests.length !== 1) { |
| 913 chrome.test.notifyFail('Test not found ' + args.test); | 893 chrome.test.notifyFail('Test not found ' + args.test); |
| 914 return; | 894 return; |
| 915 } | 895 } |
| 916 | 896 |
| 917 chrome.test.runTests(tests); | 897 chrome.test.runTests(tests); |
| 918 }); | 898 }); |
| OLD | NEW |