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

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

Issue 16820007: Expose crypto.getRandomValues() to workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description("Tests the limits of crypto.randomValues.");
11
12 if (!window.ArrayBuffer)
13 debug("This test requres ArrayBuffers to run!");
14
15 shouldBe("'crypto' in window", "true");
16 shouldBe("'getRandomValues' in window.crypto", "true");
17
18 try {
19 var almostTooLargeArray = new Uint8Array(65536);
20 var tooLargeArray = new Uint8Array(65537);
21
22 shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)");
23 shouldThrow("crypto.getRandomValues(tooLargeArray)");
24 } catch(ex) {
25 debug(ex);
26 }
27
28 </script>
29 <script src="../fast/js/resources/js-test-post.js"></script>
30 </body>
31 </html>
32
33
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698