OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 <script src="resources/common.js"></script> | |
6 </head> | |
7 <body> | |
8 <p id="description"></p> | |
9 <div id="console"></div> | |
10 | |
11 <script> | |
12 description("Tests generateKey() with bad AES-KW parameters."); | |
13 jsTestIsAsync = true; | |
14 | |
15 extractable = true; | |
16 keyUsages = ['wrapKey', 'unwrapKey']; | |
17 | |
18 Promise.resolve(null).then(function() { | |
19 debug("\ngenerateKey() without length..."); | |
20 return crypto.subtle.generateKey({ name: 'aes-kw' }, extractable, keyUsages)
; | |
21 }).then(failAndFinishJSTest, function(result) { | |
22 logError(result); | |
23 | |
24 debug("\ngenerateKey() with a length of 70000..."); | |
25 return crypto.subtle.generateKey({ name: 'aes-kw', length: 70000 }, extracta
ble, keyUsages); | |
26 }).then(failAndFinishJSTest, function(result) { | |
27 logError(result); | |
28 | |
29 debug("\ngenerateKey() with a length of -3..."); | |
30 return crypto.subtle.generateKey({ name: 'aes-kw', length: -3 }, extractable
, keyUsages); | |
31 }).then(failAndFinishJSTest, function(result) { | |
32 logError(result); | |
33 | |
34 debug("\ngenerateKey() with length that is minus Infinity..."); | |
35 return crypto.subtle.generateKey({ name: 'aes-kw', length: -Infinity }, extr
actable, keyUsages); | |
36 }).then(failAndFinishJSTest, function(result) { | |
37 logError(result); | |
38 }).then(finishJSTest, failAndFinishJSTest); | |
39 | |
40 </script> | |
41 | |
42 </body> | |
43 </html> | |
OLD | NEW |