Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / crypto / test / test_WebCrypto_Import_Keys_Too_Long.html
blob57dfb7072ed3c5f0c1ce6811df88bbbeb5cd2515
1 <!DOCTYPE html>
2 <html>
4 <head>
5 <title>WebCrypto Test Suite</title>
6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 <link rel="stylesheet" href="./test_WebCrypto.css"/>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <!-- General testing framework -->
11 <script src="./test-array.js"></script>
13 <script>/* <![CDATA[*/
14 "use strict";
16 // -----------------------------------------------------------------------------
17 TestArray.addTest(
18 "Import a key that is too long.",
19 function() {
20 var k = new Uint8Array(0x20000010);
21 window.crypto.subtle.importKey("raw", k, "AES-GCM", true, ["encrypt", "decrypt"]).then(key => {
22 return window.crypto.subtle.encrypt(
23 { name: "AES-GCM", iv: new ArrayBuffer(96 / 8) },
24 key, new Uint8Array(32));
25 }).then(error(this), complete(this))
28 /* ]]>*/</script>
29 </head>
31 <body>
33 <div id="content">
34 <div id="head">
35 <b>Web</b>Crypto<br>
36 </div>
38 <div id="start" onclick="start();">RUN ALL</div>
40 <div id="resultDiv" class="content">
41 Summary:
42 <span class="pass"><span id="passN">0</span> passed, </span>
43 <span class="fail"><span id="failN">0</span> failed, </span>
44 <span class="pending"><span id="pendingN">0</span> pending.</span>
45 <br/>
46 <br/>
48 <table id="results">
49 <tr>
50 <th>Test</th>
51 <th>Result</th>
52 <th>Time</th>
53 </tr>
54 </table>
56 </div>
58 <div id="foot"></div>
59 </div>
61 </body>
62 </html>