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

Side by Side Diff: LayoutTests/crypto/importKey.html

Issue 144093009: [webcrypto] Remove code supporting Key.algorithm. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « no previous file | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 11 matching lines...) Expand all
22 extractable = true; 22 extractable = true;
23 // Note there are duplicates 23 // Note there are duplicates
24 keyUsages = ['encrypt', 'encrypt', 'encrypt', 'sign']; 24 keyUsages = ['encrypt', 'encrypt', 'encrypt', 'sign'];
25 25
26 return crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyU sages); 26 return crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyU sages);
27 }).then(function(result) { 27 }).then(function(result) {
28 key = result; 28 key = result;
29 shouldBe("key.type", "'secret'") 29 shouldBe("key.type", "'secret'")
30 shouldBe("key.extractable", "true") 30 shouldBe("key.extractable", "true")
31 shouldBe("key.algorithm.name", "'HMAC'") 31 shouldBe("key.algorithm.name", "'HMAC'")
32 shouldBe("key.algorithm.hash.name", "'SHA-256'")
33 shouldBe("key.usages.join(',')", "'encrypt,sign'") 32 shouldBe("key.usages.join(',')", "'encrypt,sign'")
34 33
35 // Same test as above, but with an keyUsages, and AES-CBC. 34 // Same test as above, but with an keyUsages, and AES-CBC.
36 keyFormat = "raw"; 35 keyFormat = "raw";
37 data = asciiToUint8Array("16 bytes of key!"); 36 data = asciiToUint8Array("16 bytes of key!");
38 algorithm = aesCbc; 37 algorithm = aesCbc;
39 extractable = true; 38 extractable = true;
40 keyUsages = []; 39 keyUsages = [];
41 40
42 return crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyU sages); 41 return crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyU sages);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'hmac'}, extractable, keyUsages)"); 112 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'hmac'}, extractable, keyUsages)");
114 113
115 // SHA-1 doesn't support the importKey operation. 114 // SHA-1 doesn't support the importKey operation.
116 shouldThrow("crypto.subtle.importKey(keyFormat, data, {name: 'sha-1'}, extra ctable, keyUsages)"); 115 shouldThrow("crypto.subtle.importKey(keyFormat, data, {name: 'sha-1'}, extra ctable, keyUsages)");
117 }).then(finishJSTest, failAndFinishJSTest); 116 }).then(finishJSTest, failAndFinishJSTest);
118 117
119 </script> 118 </script>
120 119
121 </body> 120 </body>
122 </html> 121 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698