blob: 082537edb53cdcdf333b0c5c2e24ef1bbdd8581e [file] [log] [blame]
Test generating an HMAC key with malformed-paramters.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of (object or DOMString).
PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of (object or DOMString).
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: null}, extractable, ["sign", "verify"]) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: Symbol()}, extractable, ["sign", "verify"]) rejected promise with TypeError: Cannot convert a symbol to a number.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: { }}, extractable, ["sign", "verify"]) rejected promise with TypeError: Value NaN is outside the range [0, 4294967295].
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: "foo"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Value NaN is outside the range [0, 4294967295].
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["encrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["decrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["deriveKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["deriveBits"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["wrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["unwrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 0}, extractable, ["sign", "verify"]) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: 5}, extractable, ["sign", "verify"]) rejected promise with OperationError: The operation failed for an operation-specific reason.
PASS successfullyParsed is true
TEST COMPLETE