Index: chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js |
diff --git a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js |
index 557ae680c4cf2d22d441f75f4426449e1c7d161d..a9374e7a91cc3586a0e3dbc3102e925a40ae049d 100644 |
--- a/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js |
+++ b/chrome/test/data/extensions/api_test/enterprise_platform_keys/basic.js |
@@ -358,6 +358,47 @@ function runTests(userToken) { |
]); |
}, |
+ // Call generate key with invalid algorithm parameter, missing |
+ // modulusLength. |
+ function algorithmParameterMissingModulusLength() { |
+ var algorithm = { |
+ name: "RSASSA-PKCS1-v1_5", |
+ publicExponent: |
+ new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 |
+ hash: { |
+ name: "SHA-1", |
+ } |
+ }; |
+ userToken.subtleCrypto.generateKey(algorithm, false, ['sign']).then( |
+ function(keyPair) { |
+ assertTrue(false, 'generateKey was expected to fail'); |
+ }, |
+ callbackPass(function(error) { |
+ assertEq( |
+ new Error('Error: A required parameter was missing our out-of-range'), |
+ error); |
+ })); |
+ }, |
+ |
+ // Call generate key with invalid algorithm parameter, missing hash. |
+ function algorithmParameterMissingHash() { |
+ var algorithm = { |
+ name: 'RSASSA-PKCS1-v1_5', |
+ modulusLength: 512, |
+ publicExponent: |
+ new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 |
+ }; |
+ userToken.subtleCrypto.generateKey(algorithm, false, ['sign']).then( |
+ function(keyPair) { |
+ assertTrue(false, 'generateKey was expected to fail'); |
+ }, |
+ callbackPass(function(error) { |
+ assertEq( |
+ new Error('Error: A required parameter was missing our out-of-range'), |
+ error); |
+ })); |
+ }, |
+ |
// Imports a certificate for which now private key was imported/generated |
// before. |
function missingPrivateKey() { |