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

Side by Side Diff: LayoutTests/crypto/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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../fast/js/resources/js-test-pre.js"></script> 4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 <script src="resources/utilities.js"></script>
eroman 2013/06/12 17:32:39 This script inclusion was bogus, so I removed.
6 </head> 5 </head>
7 <body> 6 <body>
8 <p id="description"></p> 7 <p id="description"></p>
9 <div id="console"></div> 8 <div id="console"></div>
10 <script> 9 <script>
11 description("Tests the limits of crypto.randomValues."); 10 description("Tests the limits of crypto.randomValues.");
12 11
13 if (!window.ArrayBuffer) 12 if (!window.ArrayBuffer)
14 debug("This test requres ArrayBuffers to run!"); 13 debug("This test requres ArrayBuffers to run!");
15 14
16 shouldBe("'crypto' in window", "true"); 15 shouldBe("'crypto' in window", "true");
17 shouldBe("'getRandomValues' in window.crypto", "true"); 16 shouldBe("'getRandomValues' in window.crypto", "true");
18 17
19 try { 18 try {
20 var almostTooLargeArray = new Uint8Array(65536); 19 var almostTooLargeArray = new Uint8Array(65536);
21 var tooLargeArray = new Uint8Array(65537); 20 var tooLargeArray = new Uint8Array(65537);
22 21
23 shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)"); 22 shouldNotThrow("crypto.getRandomValues(almostTooLargeArray)");
24 shouldThrow("crypto.getRandomValues(tooLargeArray)"); 23 shouldThrow("crypto.getRandomValues(tooLargeArray)");
25 } catch(ex) { 24 } catch(ex) {
26 debug(ex); 25 debug(ex);
27 } 26 }
28 27
29 </script> 28 </script>
30 <script src="../fast/js/resources/js-test-post.js"></script> 29 <script src="../fast/js/resources/js-test-post.js"></script>
31 </body> 30 </body>
32 </html> 31 </html>
33 32
34 33
OLDNEW
« no previous file with comments | « LayoutTests/crypto/crypto-random-values-expected.txt ('k') | LayoutTests/crypto/crypto-random-values-limits-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698