OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../fast/js/resources/js-test-pre.js"></script> | |
5 <script src="resources/utilities.js"></script> | |
6 </head> | |
7 <body> | |
8 <p id="description"></p> | |
9 <div id="console"></div> | |
10 <script> | |
11 description("Tests the limits of crypto.randomValues."); | |
12 | |
13 if (!window.ArrayBuffer) | |
14 debug("This test requres ArrayBuffers to run!"); | |
15 | |
16 shouldBe("'crypto' in window", "true"); | |
17 shouldBe("'getRandomValues' in window.crypto", "true"); | |
18 | |
19 try { | |
20 var almostTooLargeArray = new Uint8Array(65536); | |
21 var tooLargeArray = new Uint8Array(65537); | |
22 | |
23 shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)"); | |
24 shouldThrow("crypto.getRandomValues(tooLargeArray)"); | |
25 } catch(ex) { | |
26 debug(ex); | |
27 } | |
28 | |
29 </script> | |
30 <script src="../fast/js/resources/js-test-post.js"></script> | |
31 </body> | |
32 </html> | |
33 | |
34 | |
OLD | NEW |