OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 | 10 |
11 <script> | 11 <script> |
12 description("Tests cypto.subtle.exportKey."); | 12 description("Tests cypto.subtle.exportKey."); |
13 | 13 |
14 jsTestIsAsync = true; | 14 jsTestIsAsync = true; |
15 | 15 |
16 importTestKeys().then(function(result) { | 16 addTask(importTestKeys().then(function(result) { |
17 keys = result; | 17 keys = result; |
18 | 18 |
19 // Invalid export formats. | 19 // Invalid export formats. |
20 shouldThrow("crypto.subtle.exportKey(3, keys.aesCbcJustDecrypt)"); | 20 shouldThrow("crypto.subtle.exportKey(3, keys.aesCbcJustDecrypt)"); |
21 shouldThrow("crypto.subtle.exportKey(null, keys.aesCbcJustDecrypt)"); | 21 shouldThrow("crypto.subtle.exportKey(null, keys.aesCbcJustDecrypt)"); |
22 shouldThrow("crypto.subtle.exportKey('invalid', keys.aesCbcJustDecrypt)"); | 22 shouldThrow("crypto.subtle.exportKey('invalid', keys.aesCbcJustDecrypt)"); |
23 | 23 |
24 // Invalid keys | 24 // Invalid keys |
25 shouldThrow("crypto.subtle.exportKey('raw', null)"); | 25 shouldThrow("crypto.subtle.exportKey('raw', null)"); |
26 shouldThrow("crypto.subtle.exportKey('raw', 3)"); | 26 shouldThrow("crypto.subtle.exportKey('raw', 3)"); |
27 | 27 |
28 shouldBe("keys.aesCbcJustDecrypt.extractable", "false") | 28 shouldBe("keys.aesCbcJustDecrypt.extractable", "false") |
29 shouldThrow("crypto.subtle.exportKey('raw', keys.aesCbcJustDecrypt)"); | 29 shouldRejectPromiseWithNull("crypto.subtle.exportKey('raw', keys.aesCbcJustD
ecrypt)"); |
30 | 30 |
31 // TODO(eroman): exportKey() is not implemented. | 31 // TODO(eroman): exportKey() is not implemented. |
32 }).then(finishJSTest, failAndFinishJSTest); | 32 })); |
| 33 |
| 34 completeTestWhenAllTasksDone(); |
33 | 35 |
34 </script> | 36 </script> |
35 | 37 |
36 </body> | 38 </body> |
37 </html> | 39 </html> |
OLD | NEW |