Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Test that verifies that apps with only networking API alias permission | |
| 6 // can invoke API methods and listen to API events without encountering | |
| 7 // API access problems. | |
| 8 | |
| 9 chrome.test.runTests([ | |
| 10 function getProperties() { | |
| 11 chrome.networking.onc.getProperties( | |
| 12 'stub_wifi1_guid', | |
| 13 chrome.test.callbackPass(function(result) { | |
| 14 chrome.test.assertEq('stub_wifi1_guid', result.GUID); | |
| 15 chrome.test.assertEq( | |
| 16 chrome.networking.onc.ConnectionStateType.CONNECTED, | |
| 17 result.ConnectionState); | |
| 18 chrome.test.assertEq('User', result.Source); | |
| 19 })); | |
| 20 }, | |
| 21 function changeConnectionStateAndWaitForNetworksChanged() { | |
| 22 chrome.test.listenOnce( | |
| 23 chrome.networking.onc.onNetworksChanged, | |
| 24 function(networks) { | |
| 25 chrome.test.assertEq(['stub_wifi1_guid'], networks); | |
| 26 }); | |
| 27 chrome.networking.onc.startDisconnect( | |
| 28 'stub_wifi1_guid', | |
| 29 chrome.test.callbackPass(function() {})); | |
| 30 }, | |
| 31 function verifyConnectionStateChanged() { | |
| 32 chrome.networking.onc.getProperties( | |
| 33 'stub_wifi1_guid', | |
| 34 chrome.test.callbackPass(function(result) { | |
| 35 chrome.test.assertEq('stub_wifi1_guid', result.GUID); | |
| 36 chrome.test.assertFalse( | |
| 37 result.ConnectionState == | |
| 38 chrome.networking.onc.ConnectionStateType.CONNECTED); | |
| 39 })); | |
| 40 } | |
|
Devlin
2016/12/12 23:25:47
Can we add a test that this extension cannot acces
tbarzic
2016/12/12 23:55:42
Done.
| |
| 41 ]); | |
| OLD | NEW |