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

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

Issue 2620463003: Add getGlobalPolicy to networkingPrivate API. (Closed)
Patch Set: Add dcheck 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 (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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 kCellularGuid, newPin, kDefaultPuk, 866 kCellularGuid, newPin, kDefaultPuk,
867 callbackPass(function() { 867 callbackPass(function() {
868 // Set state with the new PIN, expect success. 868 // Set state with the new PIN, expect success.
869 var simState = {requirePin: true, currentPin: newPin}; 869 var simState = {requirePin: true, currentPin: newPin};
870 chrome.networkingPrivate.setCellularSimState( 870 chrome.networkingPrivate.setCellularSimState(
871 kCellularGuid, simState, networkCallbackPass()); 871 kCellularGuid, simState, networkCallbackPass());
872 })); 872 }));
873 })); 873 }));
874 })); 874 }));
875 }))); 875 })));
876 } 876 },
877 function getGlobalPolicy() {
878 chrome.networkingPrivate.getGlobalPolicy(callbackPass(function(result) {
879 assertEq({
880 AllowOnlyPolicyNetworksToAutoconnect: true,
881 AllowOnlyPolicyNetworksToConnect: false,
882 }, result);
883 }));
884 },
877 ]; 885 ];
878 886
879 chrome.test.getConfig(function(config) { 887 chrome.test.getConfig(function(config) {
880 var args = JSON.parse(config.customArg); 888 var args = JSON.parse(config.customArg);
881 var tests = availableTests.filter(function(op) { 889 var tests = availableTests.filter(function(op) {
882 return args.test == op.name; 890 return args.test == op.name;
883 }); 891 });
884 if (tests.length !== 1) { 892 if (tests.length !== 1) {
885 chrome.test.notifyFail('Test not found ' + args.test); 893 chrome.test.notifyFail('Test not found ' + args.test);
886 return; 894 return;
887 } 895 }
888 896
889 chrome.test.runTests(tests); 897 chrome.test.runTests(tests);
890 }); 898 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698