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

Side by Side Diff: LayoutTests/crypto/subtle/hmac/sign-verify.html

Issue 957713004: [WebCrypto] Split LayoutTests/crypto/subtle into per-algorithm directories (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to latest master Created 5 years, 10 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="resources/common.js"></script> 5 <script src="../resources/common.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
11 <script> 11 <script>
12 description("Tests sign() and verify() for HMAC"); 12 description("Tests sign() and verify() for HMAC");
13 13
14 jsTestIsAsync = true; 14 jsTestIsAsync = true;
15 15
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 var algorithm = {name: 'HMAC'}; 85 var algorithm = {name: 'HMAC'};
86 86
87 var key = null; 87 var key = null;
88 var keyData = hexStringToUint8Array(testCase.key); 88 var keyData = hexStringToUint8Array(testCase.key);
89 var usages = ['sign', 'verify']; 89 var usages = ['sign', 'verify'];
90 var extractable = false; 90 var extractable = false;
91 91
92 // (1) Import the key 92 // (1) Import the key
93 return crypto.subtle.importKey('raw', keyData, importAlgorithm, extractable, usages).then(function(result) { 93 return crypto.subtle.importKey('raw', keyData, importAlgorithm, extractable, usages).then(function(result) {
94 key = result; 94 key = result;
95 95
96 // shouldBe() can only resolve variables in global context. 96 // shouldBe() can only resolve variables in global context.
97 tmpKey = key; 97 tmpKey = key;
98 shouldEvaluateAs("tmpKey.type", "secret"); 98 shouldEvaluateAs("tmpKey.type", "secret");
99 shouldEvaluateAs("tmpKey.extractable", false); 99 shouldEvaluateAs("tmpKey.extractable", false);
100 shouldEvaluateAs("tmpKey.algorithm.name", "HMAC"); 100 shouldEvaluateAs("tmpKey.algorithm.name", "HMAC");
101 shouldEvaluateAs("tmpKey.algorithm.hash.name", testCase.hash); 101 shouldEvaluateAs("tmpKey.algorithm.hash.name", testCase.hash);
102 shouldEvaluateAs("tmpKey.algorithm.length", keyData.length * 8); 102 shouldEvaluateAs("tmpKey.algorithm.length", keyData.length * 8);
103 shouldEvaluateAs("tmpKey.usages.join(',')", "sign,verify"); 103 shouldEvaluateAs("tmpKey.usages.join(',')", "sign,verify");
104 104
105 // (2) Sign. 105 // (2) Sign.
(...skipping 25 matching lines...) Expand all
131 }) 131 })
132 }) 132 })
133 }); 133 });
134 134
135 lastPromise.then(finishJSTest, failAndFinishJSTest); 135 lastPromise.then(finishJSTest, failAndFinishJSTest);
136 136
137 </script> 137 </script>
138 138
139 </body> 139 </body>
140 </html> 140 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/subtle/hmac/legacy-empty-key-expected.txt ('k') | LayoutTests/crypto/subtle/hmac/sign-verify-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698