4 <script src=
"../../../resources/js-test.js"></script>
5 <script src=
"../resources/common.js"></script>
8 <p id=
"description"></p>
9 <div id=
"console"></div>
12 description("Tests generateKey() with bad AES-CTR parameters.");
16 keyUsages
= ['encrypt', 'decrypt'];
18 Promise
.resolve(null).then(function() {
19 debug("\ngenerateKey() without length...");
20 return crypto
.subtle
.generateKey({ name
: 'aes-ctr' }, extractable
, keyUsages
);
21 }).then(failAndFinishJSTest
, function(result
) {
24 debug("\ngenerateKey() with a length of 70000...");
25 return crypto
.subtle
.generateKey({ name
: 'aes-ctr', length
: 70000 }, extractable
, keyUsages
);
26 }).then(failAndFinishJSTest
, function(result
) {
29 debug("\ngenerateKey() with a length of -3...");
30 return crypto
.subtle
.generateKey({ name
: 'aes-ctr', length
: -3 }, extractable
, keyUsages
);
31 }).then(failAndFinishJSTest
, function(result
) {
34 debug("\ngenerateKey() with length that is minus Infinity...");
35 return crypto
.subtle
.generateKey({ name
: 'aes-ctr', length
: -Infinity
}, extractable
, keyUsages
);
36 }).then(failAndFinishJSTest
, function(result
) {
38 }).then(finishJSTest
, failAndFinishJSTest
);