Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/platform_keys/basic.js |
| diff --git a/chrome/test/data/extensions/api_test/platform_keys/basic.js b/chrome/test/data/extensions/api_test/platform_keys/basic.js |
| index 8f0928cac0dc8faec01f061efa5d736cd4cb5f1f..2f8b1f5e2253daa9b18c4cf659c32188b30792d6 100644 |
| --- a/chrome/test/data/extensions/api_test/platform_keys/basic.js |
| +++ b/chrome/test/data/extensions/api_test/platform_keys/basic.js |
| @@ -197,6 +197,16 @@ var requestAll = { |
| certificateAuthorities: [] |
| }; |
| +var requestRSA = { |
|
pneubeck (no reviews)
2015/05/19 10:09:00
as these two variables are used only once, just ma
cschuet (SLOW)
2015/05/19 11:36:23
Done.
|
| + certificateTypes: ['rsaSign'], |
| + certificateAuthorities: [] |
| +}; |
| + |
| +var requestECDSA = { |
| + certificateTypes: ['ecdsaSign'], |
| + certificateAuthorities: [] |
| +}; |
| + |
| // Depends on |data|, thus it cannot be created immediately. |
| function requestCA1() { |
| return { |
| @@ -237,7 +247,7 @@ function testInteractiveSelectClient1() { |
| [data.client_1]); |
| } |
| -function testMatchResult() { |
| +function testMatchResultCA1() { |
| chrome.platformKeys.selectClientCertificates( |
| {interactive: false, request: requestCA1()}, |
| callbackPass(function(matches) { |
| @@ -253,6 +263,32 @@ function testMatchResult() { |
| })); |
| } |
| +function testMatchResultECDSA() { |
| + chrome.platformKeys.selectClientCertificates( |
| + {interactive: false, request: requestECDSA}, |
| + callbackPass(function(matches) { |
| + assertEq( |
| + 0, matches.length, |
|
pneubeck (no reviews)
2015/05/19 10:09:00
is this autoformatted?
cschuet (SLOW)
2015/05/19 11:36:23
Done.
|
| + 'No matches expected.'); |
| + })); |
| +} |
| + |
| +function testMatchResultRSA() { |
| + chrome.platformKeys.selectClientCertificates( |
| + {interactive: false, request: requestRSA}, |
| + callbackPass(function(matches) { |
| + var expectedAlgorithm = { |
| + modulusLength: 2048, |
| + name: "RSASSA-PKCS1-v1_5", |
| + publicExponent: new Uint8Array([0x01, 0x00, 0x01]) |
| + }; |
| + var actualAlgorithm = matches[0].keyAlgorithm; |
| + assertEq( |
| + expectedAlgorithm, actualAlgorithm, |
| + 'Member algorithm of Match does not equal the expected algorithm'); |
| + })); |
| +} |
| + |
| function testGetKeyPairMissingAlgorithName() { |
| var keyParams = { |
| // This is missing the algorithm name. |
| @@ -433,7 +469,9 @@ var testSuites = { |
| testBackgroundInteractiveSelect, |
| testSelectCA1Certs, |
| testInteractiveSelectNoCerts, |
| - testMatchResult, |
| + testMatchResultCA1, |
| + testMatchResultECDSA, |
| + testMatchResultRSA, |
| testGetKeyPairMissingAlgorithName, |
| testGetKeyPairRejectsRSAPSS, |
| testGetKeyPair, |