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

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

Issue 2620463003: Add getGlobalPolicy to networkingPrivate API. (Closed)
Patch Set: Created 3 years, 11 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This just tests the interface. It does not test for specific results, only 5 // This just tests the interface. It does not test for specific results, only
6 // that callbacks are correctly invoked, expected parameters are correct, 6 // that callbacks are correctly invoked, expected parameters are correct,
7 // and failures are detected. 7 // and failures are detected.
8 8
9 var callbackPass = chrome.test.callbackPass; 9 var callbackPass = chrome.test.callbackPass;
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 }, 120 },
121 function unlockCellularSim() { 121 function unlockCellularSim() {
122 chrome.networkingPrivate.unlockCellularSim( 122 chrome.networkingPrivate.unlockCellularSim(
123 kGuid, '1111', callbackPass(callbackResult)); 123 kGuid, '1111', callbackPass(callbackResult));
124 }, 124 },
125 function setCellularSimState() { 125 function setCellularSimState() {
126 var simState = { requirePin: true, currentPin: '1111', newPin: '1234' }; 126 var simState = { requirePin: true, currentPin: '1111', newPin: '1234' };
127 chrome.networkingPrivate.setCellularSimState( 127 chrome.networkingPrivate.setCellularSimState(
128 kGuid, simState, callbackPass(callbackResult)); 128 kGuid, simState, callbackPass(callbackResult));
129 }, 129 },
130 function getGlobalPolicy() {
131 chrome.networkingPrivate.getGlobalPolicy(callbackPass(callbackResult(
132 function(result) {
133 return JSON.stringify(result) == JSON.stringify({
tbarzic 2017/01/06 22:43:17 assertEq() should work here as well
stevenjb 2017/01/09 19:30:37 It doesn't actually, I don't recall why. I'm going
134 AllowOnlyPolicyNetworksToAutoconnect: true,
135 AllowOnlyPolicyNetworksToConnect: false,
136 });
137 })));
138 }
130 ]; 139 ];
131 140
132 var testToRun = window.location.search.substring(1); 141 var testToRun = window.location.search.substring(1);
133 chrome.test.runTests(availableTests.filter(function(op) { 142 chrome.test.runTests(availableTests.filter(function(op) {
134 return op.name == testToRun; 143 return op.name == testToRun;
135 })); 144 }));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698