| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // Test that verifies that apps with only networking API alias permission | 5 // Test that verifies that apps with only networking API alias permission |
| 6 // can invoke API methods and listen to API events without encountering | 6 // can invoke API methods and listen to API events without encountering |
| 7 // API access problems. | 7 // API access problems. |
| 8 | 8 |
| 9 chrome.test.runTests([ | 9 chrome.test.runTests([ |
| 10 function onlyAliasBindingsPresent() { | 10 function onlyAliasBindingsPresent() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 }, | 37 }, |
| 38 function verifyConnectionStateChanged() { | 38 function verifyConnectionStateChanged() { |
| 39 chrome.networking.onc.getProperties( | 39 chrome.networking.onc.getProperties( |
| 40 'stub_wifi1_guid', | 40 'stub_wifi1_guid', |
| 41 chrome.test.callbackPass(function(result) { | 41 chrome.test.callbackPass(function(result) { |
| 42 chrome.test.assertEq('stub_wifi1_guid', result.GUID); | 42 chrome.test.assertEq('stub_wifi1_guid', result.GUID); |
| 43 chrome.test.assertFalse( | 43 chrome.test.assertFalse( |
| 44 result.ConnectionState == | 44 result.ConnectionState == |
| 45 chrome.networking.onc.ConnectionStateType.CONNECTED); | 45 chrome.networking.onc.ConnectionStateType.CONNECTED); |
| 46 })); | 46 })); |
| 47 }, |
| 48 function verifyNoAccessToNetworkingPrivateOnlyMethods() { |
| 49 var expectedError = 'Requires networkingPrivate API access.'; |
| 50 chrome.networking.onc.getVisibleNetworks('All', |
| 51 chrome.test.callbackFail(expectedError)); |
| 52 chrome.networking.onc.getEnabledNetworkTypes( |
| 53 chrome.test.callbackFail(expectedError)); |
| 54 var stubVerificationProperties = { |
| 55 certificate: '', |
| 56 publicKey: '', |
| 57 nonce: '', |
| 58 signedData: '', |
| 59 deviceSerial: '', |
| 60 deviceSsid: '', |
| 61 deviceBssid: '' |
| 62 }; |
| 63 chrome.networking.onc.verifyDestination( |
| 64 stubVerificationProperties, chrome.test.callbackFail(expectedError)); |
| 65 chrome.networking.onc.verifyAndEncryptCredentials( |
| 66 stubVerificationProperties, '', |
| 67 chrome.test.callbackFail(expectedError)); |
| 68 chrome.networking.onc.verifyAndEncryptData( |
| 69 stubVerificationProperties, '', |
| 70 chrome.test.callbackFail(expectedError)); |
| 71 chrome.networking.onc.setWifiTDLSEnabledState('', false, |
| 72 chrome.test.callbackFail(expectedError)); |
| 73 chrome.networking.onc.getWifiTDLSStatus('', |
| 74 chrome.test.callbackFail(expectedError)); |
| 47 } | 75 } |
| 48 ]); | 76 ]); |
| OLD | NEW |