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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/generateKey.html
diff --git a/LayoutTests/crypto/generateKey.html b/LayoutTests/crypto/generateKey.html
index fd2a424c0934a4db581b86081cb530d35b0c580c..6a14aaaca64f59e856fe82d56baca19259c5f809 100644
--- a/LayoutTests/crypto/generateKey.html
+++ b/LayoutTests/crypto/generateKey.html
@@ -90,6 +90,29 @@ crypto.subtle.generateKey({name: 'aes-cbc', length: 1024.9}, extractable, ['decr
shouldBe("key.algorithm.hash.name", "'SHA-256'")
shouldBe("key.algorithm.length", "48")
shouldBe("key.usages.join(',')", "'sign'")
+
+ return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength: 10, publicExponent: new Uint8Array([0])}, false, ['sign']);
+}).then(function(result) {
+ keyPair = result;
+
+ shouldBeDefined("keyPair.publicKey");
+ shouldBeDefined("keyPair.privateKey");
+
+ shouldBe("keyPair.publicKey.type", "'public'");
+ shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+
+ shouldBe("keyPair.privateKey.type", "'private'");
+ shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
+
+ // KeyPair should return the same Key wrapper
+ keyPair.publicKey.foo = "bar";
+ shouldBe("keyPair.publicKey.foo", "'bar'");
+ if (window.gc) {
+ window.gc();
+ window.gc();
+ }
+ shouldBe("keyPair.publicKey.foo", "'bar'");
+
}).then(finishJSTest, failAndFinishJSTest);
</script>
« 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