blob: 313d96280b7c14e469c7604b1509f3b3ecd97c66 [file] [log] [blame]
Test encrypting using AES-CBC with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.encrypt("aes-cbc", key, plainText) rejected promise with TypeError: Member AesCbcParams.iv is required and must be an instance of BufferSource.
PASS crypto.subtle.encrypt({name: "aes-cbc"}, key, plainText) rejected promise with TypeError: Member AesCbcParams.iv is required and must be an instance of BufferSource.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: true}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: 1}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: null}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: undefined}, key, plainText) rejected promise with TypeError: Member AesCbcParams.iv is required and must be an instance of BufferSource.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: Symbol()}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: { }}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: "foo"}, key, plainText) rejected promise with TypeError: Type error.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("")}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("j")}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd")}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
PASS successfullyParsed is true
TEST COMPLETE