blob: b8c0d4dceebc0d8d91c4b9018d5ce6b5f108566b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Tests the limits of crypto.randomValues.");
if (!window.ArrayBuffer)
debug("This test requres ArrayBuffers to run!");
shouldBe("'crypto' in window", "true");
shouldBe("'getRandomValues' in window.crypto", "true");
try {
var almostTooLargeArray = new Uint8Array(65536);
var tooLargeArray = new Uint8Array(65537);
shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)");
shouldThrow("crypto.getRandomValues(tooLargeArray)");
} catch(ex) {
debug(ex);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>