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