OLD | NEW |
1 if (self.importScripts) | 1 if (self.importScripts) |
2 importScripts('../resources/js-test.js'); | 2 importScripts('../resources/js-test.js'); |
3 | 3 |
4 description("Tests crypto.randomValues."); | 4 description("Tests 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"); |
(...skipping 19 matching lines...) Expand all Loading... |
30 for (var i = 0; i < reference.length; i++) { | 30 for (var i = 0; i < reference.length; i++) { |
31 if (reference[i] == sample[i]) | 31 if (reference[i] == sample[i]) |
32 matchingBytes++; | 32 matchingBytes++; |
33 } | 33 } |
34 | 34 |
35 shouldBe("matchingBytes < 100", "true"); | 35 shouldBe("matchingBytes < 100", "true"); |
36 } catch(ex) { | 36 } catch(ex) { |
37 debug(ex); | 37 debug(ex); |
38 } | 38 } |
39 | 39 |
| 40 if (self.SharedArrayBuffer) { |
| 41 shouldThrow("crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100
)))"); |
| 42 } |
| 43 |
40 finishJSTest(); | 44 finishJSTest(); |
OLD | NEW |