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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
875 }))); | 875 }))); |
876 }, | 876 }, |
877 function getGlobalPolicy() { | 877 function getGlobalPolicy() { |
878 chrome.networkingPrivate.getGlobalPolicy(callbackPass(function(result) { | 878 chrome.networkingPrivate.getGlobalPolicy(callbackPass(function(result) { |
879 assertEq({ | 879 assertEq({ |
880 AllowOnlyPolicyNetworksToAutoconnect: true, | 880 AllowOnlyPolicyNetworksToAutoconnect: true, |
881 AllowOnlyPolicyNetworksToConnect: false, | 881 AllowOnlyPolicyNetworksToConnect: false, |
882 }, result); | 882 }, result); |
883 })); | 883 })); |
884 }, | 884 }, |
885 function createConfigForPolicyControlledNetwork() { | |
886 chrome.networkingPrivate.getProperties('stub_wifi2', callbackPass(function( | |
887 properties) { | |
888 // Sanity check to verify there is a policy defined config for the network | |
889 // config that will be set up in this test. | |
890 chrome.test.assertEq('UserPolicy', properties.Source); | |
891 chrome.test.assertEq('WiFi', properties.Type); | |
892 chrome.test.assertEq('WPA-PSK', properties.WiFi.Security); | |
893 chrome.test.assertEq('wifi2_PSK', properties.WiFi.SSID); | |
894 | |
895 chrome.networkingPrivate.createNetwork(false /* shared */, { | |
896 Type: 'WiFi', | |
897 WiFi: { | |
898 SSID: 'wifi2_PSK', | |
899 Passphrase: 'Fake password', | |
900 Security: 'WPA-PSK' | |
901 } | |
902 }, callbackFail('NetworkAlreadyConfigured')); | |
903 })); | |
904 }, | |
stevenjb
2017/03/27 18:01:34
nit: move this immediately after 'createNetwork()'
tbarzic
2017/03/27 18:32:33
Done.
| |
885 ]; | 905 ]; |
886 | 906 |
887 chrome.test.getConfig(function(config) { | 907 chrome.test.getConfig(function(config) { |
888 var args = JSON.parse(config.customArg); | 908 var args = JSON.parse(config.customArg); |
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 |