| 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 }, |
| 181 function forgetNetwork() { | 201 function forgetNetwork() { |
| 182 var kNumNetworks = 2; | 202 var kNumNetworks = 2; |
| 183 var kTestNetworkGuid = 'stub_wifi1_guid'; | 203 var kTestNetworkGuid = 'stub_wifi1_guid'; |
| 184 function guidExists(networks, guid) { | 204 function guidExists(networks, guid) { |
| 185 for (var n of networks) { | 205 for (var n of networks) { |
| 186 if (n.GUID == kTestNetworkGuid) | 206 if (n.GUID == kTestNetworkGuid) |
| 187 return true; | 207 return true; |
| 188 } | 208 } |
| 189 return false; | 209 return false; |
| 190 } | 210 } |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 var tests = availableTests.filter(function(op) { | 909 var tests = availableTests.filter(function(op) { |
| 890 return args.test == op.name; | 910 return args.test == op.name; |
| 891 }); | 911 }); |
| 892 if (tests.length !== 1) { | 912 if (tests.length !== 1) { |
| 893 chrome.test.notifyFail('Test not found ' + args.test); | 913 chrome.test.notifyFail('Test not found ' + args.test); |
| 894 return; | 914 return; |
| 895 } | 915 } |
| 896 | 916 |
| 897 chrome.test.runTests(tests); | 917 chrome.test.runTests(tests); |
| 898 }); | 918 }); |
| OLD | NEW |