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

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

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

Powered by Google App Engine
This is Rietveld 408576698