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

Unified Diff: LayoutTests/crypto/hmac-import-jwk.html

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update path for deserialize legacy tests Created 6 years 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
Index: LayoutTests/crypto/hmac-import-jwk.html
diff --git a/LayoutTests/crypto/hmac-import-jwk.html b/LayoutTests/crypto/hmac-import-jwk.html
deleted file mode 100644
index bc990b3c93841eccdb75d272edc191a28064cec1..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/hmac-import-jwk.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../resources/js-test.js"></script>
-<script src="resources/common.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-
-<script>
-description("Test importing a JWK key for HMAC.");
-
-jsTestIsAsync = true;
-
-var nonExtractable = false;
-var extractable = true;
-
-var hmacKey = {
- "kty": "oct",
- "alg": "HS256",
- "use": "sig",
- "ext": false,
- "k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
-};
-
-debug("Importing a key...\n");
-crypto.subtle.importKey("jwk", hmacKey, {name: "HMAC", hash: {name: "SHA-256"}}, nonExtractable, ["sign", "verify"]).then(function(result) {
- key = result;
-
- shouldBe("key.type", "'secret'");
- shouldBe("key.extractable", "false");
- shouldBe("key.algorithm.name", "'HMAC'");
- shouldBe("key.algorithm.length", "256");
- shouldBe("key.usages", '["sign", "verify"]');
-
- debug("\nUsing the key to sign message 'foo'...");
- return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
- signature = result;
- shouldBe("bytesToHexString(new Uint8Array(signature))", "'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'");
-
- debug("\nVerifying the signature...");
- return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
- verificationResult = result;
- shouldBe("verificationResult", "true");
-}).then(finishJSTest, failAndFinishJSTest);
-</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698