| <script src="../resources/js-test-pre.js"></script> |
| <script src="resources/utilities.js"></script> |
| description("Tests the limits of crypto.randomValues."); |
| debug("This test requres ArrayBuffers to run!"); |
| shouldBe("'crypto' in window", "true"); |
| shouldBe("'getRandomValues' in window.crypto", "true"); |
| var almostTooLargeArray = new Uint8Array(65536); |
| var tooLargeArray = new Uint8Array(65537); |
| shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)"); |
| shouldThrow("crypto.getRandomValues(tooLargeArray)"); |
| <script src="../resources/js-test-post.js"></script> |