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

Unified Diff: LayoutTests/crypto/generateKey.html

Issue 24467004: [webcrypto] Remove MockWebCrypto. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/crypto/exportKey-expected.txt ('k') | 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 ae1949211a71279f1939afe6e530c343d6908873..33085a760cf5693ff71740a674916dff9aebcf31 100644
--- a/LayoutTests/crypto/generateKey.html
+++ b/LayoutTests/crypto/generateKey.html
@@ -11,8 +11,6 @@
<script>
description("Tests cypto.subtle.generateKey.");
-jsTestIsAsync = true;
-
extractable = true;
keyUsages = ['encrypt', 'decrypt'];
@@ -73,61 +71,6 @@ shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5'}, extractable ,
shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength: 10}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength: 10, publicExponent: 10}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength: 10, publicExponent: null}, extractable , keyUsages)");
-
-// Note that fractional numbers are truncated, so this length should be
-// interpreted as 1024.
-crypto.subtle.generateKey({name: 'aes-cbc', length: 1024.9}, extractable, ['decrypt', 'encrypt']).then(function(result) {
- key = result;
- shouldBe("key.type", "'private'")
- shouldBe("key.extractable", "true")
- shouldBe("key.algorithm.name", "'AES-CBC'")
- shouldBe("key.algorithm.length", "1024")
- shouldBe("key.usages.join(',')", "'encrypt,decrypt'")
-
- return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }}, false, ['sign']);
-}).then(function(result) {
- key = result;
- shouldBe("key.type", "'private'")
- shouldBe("key.extractable", "false")
- shouldBe("key.algorithm.name", "'HMAC'")
- shouldBe("key.algorithm.hash.name", "'SHA-256'")
- shouldBe("key.algorithm.length", "null")
- shouldBe("key.usages.join(',')", "'sign'")
-
- return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }, length:48 }, false, ['sign']);
-}).then(function(result) {
- key = result;
- shouldBe("key.type", "'private'")
- shouldBe("key.extractable", "false")
- shouldBe("key.algorithm.name", "'HMAC'")
- 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>
<script src="../fast/js/resources/js-test-post.js"></script>
« no previous file with comments | « LayoutTests/crypto/exportKey-expected.txt ('k') | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698