OLD | NEW |
(Empty) | |
| 1 if (self.importScripts) { |
| 2 importScripts('../../fast/js/resources/js-test-pre.js'); |
| 3 } |
| 4 |
| 5 description("Tests the limits of crypto.randomValues."); |
| 6 |
| 7 if (!self.ArrayBuffer) |
| 8 debug("This test requres ArrayBuffers to run!"); |
| 9 |
| 10 shouldBe("'crypto' in self", "true"); |
| 11 shouldBe("'getRandomValues' in self.crypto", "true"); |
| 12 |
| 13 try { |
| 14 var almostTooLargeArray = new Uint8Array(65536); |
| 15 var tooLargeArray = new Uint8Array(65537); |
| 16 |
| 17 shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)"); |
| 18 shouldThrow("crypto.getRandomValues(tooLargeArray)"); |
| 19 } catch(ex) { |
| 20 debug(ex); |
| 21 } |
| 22 |
| 23 finishJSTest(); |
OLD | NEW |