Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Side by Side Diff: chrome/test/data/extensions/api_test/networking_private/alias/test.js

Issue 2470193002: Introduce networking.onc as an alias for networkingPrivate (Closed)
Patch Set: allow optional permission Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 onlyAliasBindingsPresent() {
11 chrome.test.assertTrue(!!chrome.networking);
12 chrome.test.assertTrue(!!chrome.networking.onc);
13
14 chrome.test.assertFalse(!!chrome.networkingPrivate);
15 chrome.test.succeed();
16 },
17 function getProperties() {
18 chrome.networking.onc.getProperties(
19 'stub_wifi1_guid',
20 chrome.test.callbackPass(function(result) {
21 chrome.test.assertEq('stub_wifi1_guid', result.GUID);
22 chrome.test.assertEq(
23 chrome.networking.onc.ConnectionStateType.CONNECTED,
24 result.ConnectionState);
25 chrome.test.assertEq('User', result.Source);
26 }));
27 },
28 function changeConnectionStateAndWaitForNetworksChanged() {
29 chrome.test.listenOnce(
30 chrome.networking.onc.onNetworksChanged,
31 function(networks) {
32 chrome.test.assertEq(['stub_wifi1_guid'], networks);
33 });
34 chrome.networking.onc.startDisconnect(
35 'stub_wifi1_guid',
36 chrome.test.callbackPass(function() {}));
37 },
38 function verifyConnectionStateChanged() {
39 chrome.networking.onc.getProperties(
40 'stub_wifi1_guid',
41 chrome.test.callbackPass(function(result) {
42 chrome.test.assertEq('stub_wifi1_guid', result.GUID);
43 chrome.test.assertFalse(
44 result.ConnectionState ==
45 chrome.networking.onc.ConnectionStateType.CONNECTED);
46 }));
47 }
48 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698