Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 832 kCellularGuid, newPin, kDefaultPuk, | 832 kCellularGuid, newPin, kDefaultPuk, |
| 833 callbackPass(function() { | 833 callbackPass(function() { |
| 834 // Set state with the new PIN, expect success. | 834 // Set state with the new PIN, expect success. |
| 835 var simState = {requirePin: true, currentPin: newPin}; | 835 var simState = {requirePin: true, currentPin: newPin}; |
| 836 chrome.networkingPrivate.setCellularSimState( | 836 chrome.networkingPrivate.setCellularSimState( |
| 837 kCellularGuid, simState, networkCallbackPass()); | 837 kCellularGuid, simState, networkCallbackPass()); |
| 838 })); | 838 })); |
| 839 })); | 839 })); |
| 840 })); | 840 })); |
| 841 }))); | 841 }))); |
| 842 } | 842 }, |
| 843 function getThirdPartyVPNProviders() { | |
| 844 var kVpnTestExtensionId = 'dnlobbijiphininmjcaipninhcdnknni'; | |
| 845 var kVpmTestExtensionName = 'Basic tests'; | |
| 846 chrome.networkingPrivate.getThirdPartyVPNProviders( | |
| 847 callbackPass(function(result) { | |
| 848 assertEq([{ | |
| 849 ExtensionID: kVpnTestExtensionId, | |
| 850 Name: kVpmTestExtensionName, | |
| 851 } | |
| 852 ], result); | |
| 853 })); | |
| 854 }, | |
| 855 function onThirdPartyVPNProvidersChangedEvent() { | |
| 856 var kVpnTestExtensionId = 'dnlobbijiphininmjcaipninhcdnknni'; | |
| 857 var kVpmTestExtensionName = 'Basic tests'; | |
| 858 var done = chrome.test.callbackAdded(); | |
|
pneubeck (no reviews)
2015/08/13 12:58:36
nit: you could still use the callbackPass wrapper
| |
| 859 var listener = function(providers) { | |
| 860 chrome.networkingPrivate.onThirdPartyVPNProvidersChanged.removeListener( | |
| 861 listener); | |
| 862 assertEq([{ | |
| 863 ExtensionID: kVpnTestExtensionId, | |
| 864 Name: kVpmTestExtensionName, | |
| 865 }], providers); | |
| 866 done(); | |
| 867 }; | |
| 868 chrome.networkingPrivate.onThirdPartyVPNProvidersChanged.addListener( | |
| 869 listener); | |
| 870 chrome.networkingPrivate.getThirdPartyVPNProviders(function(result) { | |
| 871 // Ensure no initial providers. | |
| 872 assertEq([], result); | |
| 873 // Tell Chrome to install a third party VPN extension which should trigger | |
| 874 // |listener|. | |
| 875 chrome.test.sendMessage('installThirdPartyVpn'); | |
| 876 }); | |
| 877 }, | |
| 843 ]; | 878 ]; |
| 844 | 879 |
| 845 var testToRun = window.location.search.substring(1); | 880 var testToRun = window.location.search.substring(1); |
| 846 chrome.test.runTests(availableTests.filter(function(op) { | 881 chrome.test.runTests(availableTests.filter(function(op) { |
| 847 return op.name == testToRun; | 882 return op.name == testToRun; |
| 848 })); | 883 })); |
| OLD | NEW |