OLD | NEW |
1 if (self.importScripts) | 1 if (self.importScripts) |
2 importScripts('../../fast/js/resources/js-test-pre.js'); | 2 importScripts('../../resources/js-test.js'); |
3 | 3 |
4 description("Tests which types are valid for crypto.randomValues."); | 4 description("Tests which types are valid for crypto.randomValues."); |
5 | 5 |
6 if (!self.ArrayBuffer) | 6 if (!self.ArrayBuffer) |
7 debug("This test requres ArrayBuffers to run!"); | 7 debug("This test requres ArrayBuffers to run!"); |
8 | 8 |
9 shouldBe("'crypto' in self", "true"); | 9 shouldBe("'crypto' in self", "true"); |
10 shouldBe("'getRandomValues' in self.crypto", "true"); | 10 shouldBe("'getRandomValues' in self.crypto", "true"); |
11 | 11 |
12 function checkIntegerTypes() { | 12 function checkIntegerTypes() { |
(...skipping 23 matching lines...) Expand all Loading... |
36 shouldBeDefined("buffer = new Uint8Array(32)"); | 36 shouldBeDefined("buffer = new Uint8Array(32)"); |
37 shouldBeDefined("buffer.buffer"); | 37 shouldBeDefined("buffer.buffer"); |
38 shouldBeDefined("view = new DataView(buffer.buffer)"); | 38 shouldBeDefined("view = new DataView(buffer.buffer)"); |
39 shouldThrow("crypto.getRandomValues(view)"); | 39 shouldThrow("crypto.getRandomValues(view)"); |
40 } | 40 } |
41 | 41 |
42 checkIntegerTypes(); | 42 checkIntegerTypes(); |
43 checkNonIntegerTypes(); | 43 checkNonIntegerTypes(); |
44 | 44 |
45 finishJSTest(); | 45 finishJSTest(); |
OLD | NEW |