mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1270599 - add test to ensure generateKey returns the correct error given an invalid algorithm argument r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D80008
This commit is contained in:
parent
6636ae8e72
commit
393a11c9f9
@ -398,7 +398,21 @@ TestArray.addTest(
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
TestArray.addTest(
|
||||
"Generate a 1024-bit RSA key",
|
||||
"Fail generating a key with bad algorithm argument",
|
||||
function() {
|
||||
var that = this;
|
||||
var alg = { name: "AES", length: 128 };
|
||||
crypto.subtle.generateKey(alg, false, ["encrypt"]).then(
|
||||
error(that),
|
||||
complete(that, function(e) {
|
||||
return e.name == "NotSupportedError";
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
TestArray.addTest( "Generate a 1024-bit RSA key",
|
||||
function() {
|
||||
var that = this;
|
||||
var alg = {
|
||||
|
Loading…
Reference in New Issue
Block a user