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

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

Issue 2891453002: Introduce networkingPrivate.getCertificateLists (Closed)
Patch Set: Rebase, fix histograms, remove from networking.onc Created 3 years, 7 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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 chrome.networkingPrivate.startConnect(network, networkCallbackPass()); 792 chrome.networkingPrivate.startConnect(network, networkCallbackPass());
793 }, 793 },
794 function onDeviceStateListChangedEvent() { 794 function onDeviceStateListChangedEvent() {
795 var listener = callbackPass(function() { 795 var listener = callbackPass(function() {
796 chrome.networkingPrivate.onDeviceStateListChanged.removeListener( 796 chrome.networkingPrivate.onDeviceStateListChanged.removeListener(
797 listener); 797 listener);
798 }); 798 });
799 chrome.networkingPrivate.onDeviceStateListChanged.addListener(listener); 799 chrome.networkingPrivate.onDeviceStateListChanged.addListener(listener);
800 chrome.networkingPrivate.disableNetworkType('WiFi'); 800 chrome.networkingPrivate.disableNetworkType('WiFi');
801 }, 801 },
802 function onCertificateListsChangedEvent() {
803 chrome.test.listenOnce(
804 chrome.networkingPrivate.onCertificateListsChanged, function() {});
805 // The test delegate will send a change event when we request the certs.
tbarzic 2017/05/23 18:01:58 I'd go with something more explicit here, e.g. chr
stevenjb 2017/05/25 00:01:11 Ah, I knew there had to be a better way. I think I
806 chrome.networkingPrivate.getCertificateLists(callbackPass(function() {}));
807 },
802 function verifyDestination() { 808 function verifyDestination() {
803 chrome.networkingPrivate.verifyDestination( 809 chrome.networkingPrivate.verifyDestination(
804 verificationProperties, 810 verificationProperties,
805 callbackPass(function(isValid) { 811 callbackPass(function(isValid) {
806 assertTrue(isValid); 812 assertTrue(isValid);
807 })); 813 }));
808 }, 814 },
809 function verifyAndEncryptCredentials() { 815 function verifyAndEncryptCredentials() {
810 var network_guid = 'stub_wifi2_guid'; 816 var network_guid = 'stub_wifi2_guid';
811 chrome.networkingPrivate.verifyAndEncryptCredentials( 817 chrome.networkingPrivate.verifyAndEncryptCredentials(
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 })); 970 }));
965 }, 971 },
966 function getTetherNetworkState() { 972 function getTetherNetworkState() {
967 chrome.networkingPrivate.getState( 973 chrome.networkingPrivate.getState(
968 'tetherGuid1', 974 'tetherGuid1',
969 callbackPass(function(tetherNetwork) { 975 callbackPass(function(tetherNetwork) {
970 privateHelpers.verifyTetherNetwork(tetherNetwork, 'tetherGuid1', 976 privateHelpers.verifyTetherNetwork(tetherNetwork, 'tetherGuid1',
971 'tetherName1', 50, 'tetherCarrier1', 75, true); 977 'tetherName1', 50, 'tetherCarrier1', 75, true);
972 })); 978 }));
973 }, 979 },
980 function getCertificateLists() {
981 chrome.networkingPrivate.getCertificateLists(
982 callbackPass(function(certificateLists) {
983 assertEq(1, certificateLists.server_ca_certificates.length);
984 assertEq(0, certificateLists.user_certificates.length);
985 }));
986 },
974 ]; 987 ];
975 988
976 chrome.test.getConfig(function(config) { 989 chrome.test.getConfig(function(config) {
977 var args = JSON.parse(config.customArg); 990 var args = JSON.parse(config.customArg);
978 var tests = availableTests.filter(function(op) { 991 var tests = availableTests.filter(function(op) {
979 return args.test == op.name; 992 return args.test == op.name;
980 }); 993 });
981 if (tests.length !== 1) { 994 if (tests.length !== 1) {
982 chrome.test.notifyFail('Test not found ' + args.test); 995 chrome.test.notifyFail('Test not found ' + args.test);
983 return; 996 return;
984 } 997 }
985 998
986 chrome.test.runTests(tests); 999 chrome.test.runTests(tests);
987 }); 1000 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698