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

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

Issue 23617006: WebCrypto: Add the KeyPair interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 7 years, 3 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/generateKey-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="../fast/js/resources/js-test-pre.js"></script> 4 <script src="../fast/js/resources/js-test-pre.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }, le ngth:48 }, false, ['sign']); 84 return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }, le ngth:48 }, false, ['sign']);
85 }).then(function(result) { 85 }).then(function(result) {
86 key = result; 86 key = result;
87 shouldBe("key.type", "'private'") 87 shouldBe("key.type", "'private'")
88 shouldBe("key.extractable", "false") 88 shouldBe("key.extractable", "false")
89 shouldBe("key.algorithm.name", "'HMAC'") 89 shouldBe("key.algorithm.name", "'HMAC'")
90 shouldBe("key.algorithm.hash.name", "'SHA-256'") 90 shouldBe("key.algorithm.hash.name", "'SHA-256'")
91 shouldBe("key.algorithm.length", "48") 91 shouldBe("key.algorithm.length", "48")
92 shouldBe("key.usages.join(',')", "'sign'") 92 shouldBe("key.usages.join(',')", "'sign'")
93
94 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength: 10, publicExponent: new Uint8Array([0])}, false, ['sign']);
95 }).then(function(result) {
96 keyPair = result;
97
98 shouldBeDefined("keyPair.publicKey");
99 shouldBeDefined("keyPair.privateKey");
100
101 shouldBe("keyPair.publicKey.type", "'public'");
102 shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
103
104 shouldBe("keyPair.privateKey.type", "'private'");
105 shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
106
107 // KeyPair should return the same Key wrapper
108 keyPair.publicKey.foo = "bar";
109 shouldBe("keyPair.publicKey.foo", "'bar'");
110 if (window.gc) {
111 window.gc();
112 window.gc();
113 }
114 shouldBe("keyPair.publicKey.foo", "'bar'");
115
93 }).then(finishJSTest, failAndFinishJSTest); 116 }).then(finishJSTest, failAndFinishJSTest);
94 117
95 </script> 118 </script>
96 119
97 <script src="../fast/js/resources/js-test-post.js"></script> 120 <script src="../fast/js/resources/js-test-post.js"></script>
98 </body> 121 </body>
99 </html> 122 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698