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