blob: 5a06d9aac78a969e5340a38b0c2a432ae1ce7464 [file] [log] [blame]
Test generating a CryptoKey object with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.generateKey() rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.generateKey(1) rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.generateKey(1, 2) rejected promise with TypeError: Not enough arguments.
PASS crypto.subtle.generateKey("foo", 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: 1}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: true}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: null}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: undefined}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: Symbol()}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: { }}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "foo"}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "hmac", hash: true}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: 1}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: null}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: undefined}, 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: Symbol()}, extractable, ["sign", "verify"]) rejected promise with TypeError: Cannot convert a symbol to a string.
PASS crypto.subtle.generateKey({name: "hmac", hash: { }}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
PASS crypto.subtle.generateKey({name: "hmac", hash: "foo"}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: true}}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: 1}}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: null}}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: undefined}}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: Symbol()}}, extractable, ["sign", "verify"]) rejected promise with TypeError: Cannot convert a symbol to a string.
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: { }}}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "hmac", hash: {name: "foo"}}, extractable, ["sign", "verify"]) rejected promise with NotSupportedError: The operation is not supported..
PASS crypto.subtle.generateKey({name: "SHA-1"}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "SHA-256"}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "SHA-384"}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "SHA-512"}, 2, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, 3) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, true) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, null) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, undefined) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, Symbol()) rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, { }) rejected promise with TypeError: Type error.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, "foo") rejected promise with TypeError: Value is not a sequence.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, ["foo"]) rejected promise with TypeError: Type error.
PASS crypto.subtle.generateKey({name: "AES-CBC", length: 128}, extractable, [ ]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.generateKey({name: "RSAES-PKCS1-v1_5", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS successfullyParsed is true
TEST COMPLETE