Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: LayoutTests/crypto/resources/random-values-limits.js

Issue 16820007: Expose crypto.getRandomValues() to workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698