OLD | NEW |
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 |
11 var kFailure = 'Failure'; | 11 var kFailure = 'Failure'; |
12 var kGuid = 'SOME_GUID'; | 12 var kGuid = 'SOME_GUID'; |
13 | 13 |
14 // Test properties for the verification API. | 14 // Test properties for the verification API. |
15 var verificationProperties = { | 15 var verificationProperties = { |
16 "certificate": "certificate", | 16 "certificate": "certificate", |
17 "intermediateCertificates": ["ica1", "ica2", "ica3"], | |
18 "publicKey": "cHVibGljX2tleQ==", // Base64("public_key") | 17 "publicKey": "cHVibGljX2tleQ==", // Base64("public_key") |
19 "nonce": "nonce", | 18 "nonce": "nonce", |
20 "signedData": "c2lnbmVkX2RhdGE=", // Base64("signed_data") | 19 "signedData": "c2lnbmVkX2RhdGE=", // Base64("signed_data") |
21 "deviceSerial": "device_serial", | 20 "deviceSerial": "device_serial", |
22 "deviceSsid": "Device 0123", | 21 "deviceSsid": "Device 0123", |
23 "deviceBssid": "00:01:02:03:04:05" | 22 "deviceBssid": "00:01:02:03:04:05" |
24 }; | 23 }; |
25 | 24 |
26 function callbackResult(result) { | 25 function callbackResult(result) { |
27 if (chrome.runtime.lastError) | 26 if (chrome.runtime.lastError) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 function getCaptivePortalStatus() { | 105 function getCaptivePortalStatus() { |
107 chrome.networkingPrivate.getWifiTDLSStatus( | 106 chrome.networkingPrivate.getWifiTDLSStatus( |
108 kGuid, callbackPass(callbackResult)); | 107 kGuid, callbackPass(callbackResult)); |
109 }, | 108 }, |
110 ]; | 109 ]; |
111 | 110 |
112 var testToRun = window.location.search.substring(1); | 111 var testToRun = window.location.search.substring(1); |
113 chrome.test.runTests(availableTests.filter(function(op) { | 112 chrome.test.runTests(availableTests.filter(function(op) { |
114 return op.name == testToRun; | 113 return op.name == testToRun; |
115 })); | 114 })); |
OLD | NEW |