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

Unified Diff: chrome/test/data/extensions/api_test/platform_keys/basic.js

Issue 1141253003: chrome.platformKeys: Add filtering by certificate types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed pneubeck's comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/platform_keys.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e874671b8d33f761cc008b8a4547200859c3dd07 100644
--- a/chrome/test/data/extensions/api_test/platform_keys/basic.js
+++ b/chrome/test/data/extensions/api_test/platform_keys/basic.js
@@ -237,7 +237,7 @@ function testInteractiveSelectClient1() {
[data.client_1]);
}
-function testMatchResult() {
+function testMatchResultCA1() {
chrome.platformKeys.selectClientCertificates(
{interactive: false, request: requestCA1()},
callbackPass(function(matches) {
@@ -253,6 +253,38 @@ function testMatchResult() {
}));
}
+function testMatchResultECDSA() {
+ var requestECDSA = {
+ certificateTypes: ['ecdsaSign'],
+ certificateAuthorities: []
+ };
+ chrome.platformKeys.selectClientCertificates(
+ {interactive: false, request: requestECDSA},
+ callbackPass(function(matches) {
+ assertEq(0, matches.length, 'No matches expected.');
+ }));
+}
+
+function testMatchResultRSA() {
+ var requestRSA = {
+ certificateTypes: ['rsaSign'],
+ certificateAuthorities: []
+ };
+ 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 +465,9 @@ var testSuites = {
testBackgroundInteractiveSelect,
testSelectCA1Certs,
testInteractiveSelectNoCerts,
- testMatchResult,
+ testMatchResultCA1,
+ testMatchResultECDSA,
+ testMatchResultRSA,
testGetKeyPairMissingAlgorithName,
testGetKeyPairRejectsRSAPSS,
testGetKeyPair,
« no previous file with comments | « chrome/common/extensions/api/platform_keys.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698