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

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

Issue 214233002: [webcrypto] Split exportKey.html test into smaller files. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/exportKey-badParameters.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 <script src="resources/keys.js"></script>
7 </head>
8 <body>
9 <p id="description"></p>
10 <div id="console"></div>
11
12 <script>
13 description("Tests cypto.subtle.exportKey.");
14
15 jsTestIsAsync = true;
16
17 addTask(importTestKeys().then(function(result) {
18 keys = result;
19
20 // Invalid export formats.
21 shouldRejectPromiseWithNull("crypto.subtle.exportKey(3, keys.aesCbcJustDecry pt)");
22 shouldRejectPromiseWithNull("crypto.subtle.exportKey(null, keys.aesCbcJustDe crypt)");
23 shouldRejectPromiseWithNull("crypto.subtle.exportKey('invalid', keys.aesCbcJ ustDecrypt)");
24
25 // Invalid keys
26 shouldThrow("crypto.subtle.exportKey('raw', null)");
27 shouldThrow("crypto.subtle.exportKey('raw', 3)");
28
29 shouldBe("keys.aesCbcJustDecrypt.extractable", "false")
30 shouldRejectPromiseWithNull("crypto.subtle.exportKey('raw', keys.aesCbcJustD ecrypt)");
31
32 return crypto.subtle.exportKey('raw', keys.aesCbc);
33 }).then(function(result) {
34 bytesShouldMatchHexString("Key bytes", "3136206279746573206f66206b657921", r esult);
35
36 return crypto.subtle.exportKey('spki', keys.rsaSsaSha1Public);
37 }).then(function(result) {
38 bytesShouldMatchHexString("Key bytes", kKeyData.rsa1.spki, result);
39 }));
40
41 completeTestWhenAllTasksDone();
42
43 </script>
44
45 </body>
46 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/exportKey-badParameters.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698