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