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

Unified Diff: LayoutTests/crypto/subtle/clone-hkdfKey.html

Issue 958353003: [WebCrypto] Move cloneKey test to respective algorithm directory (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
Index: LayoutTests/crypto/subtle/clone-hkdfKey.html
diff --git a/LayoutTests/crypto/subtle/clone-hkdfKey.html b/LayoutTests/crypto/subtle/clone-hkdfKey.html
deleted file mode 100644
index fc59d108eeb8dcdcc4b70071c00813f9e9a26cbc..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/subtle/clone-hkdfKey.html
+++ /dev/null
@@ -1,84 +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("Tests structured cloning of HKDF keys");
-
-jsTestIsAsync = true;
-
-// Tests the 18 permutations of keys generated by:
-// kPossibleHashAlgorithms x kPossibleKeyUsages x kPossibleKeyData
-//
-// For practical reasons these tests are not exhaustive.
-
-var k128BitData = "30112233445566778899aabbccddeeff"
-var k256BitData = "00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0e0f";
-
-var kPossibleHashAlgorithms = ['SHA-1', 'SHA-256', 'SHA-512'];
-var kPossibleKeyUsages = [['deriveBits'], ['deriveKey'], ['deriveKey', 'deriveBits']];
-var kPossibleKeyData = [
- k128BitData,
- k256BitData
-];
-
-function runTest(hashName, keyUsages, keyData)
-{
- var importData = hexStringToUint8Array(keyData);
- var importAlgorithm = { name: 'HKDF', hash: {name: hashName } };
-
- var results = {};
-
- var extractable = false;
- return crypto.subtle.importKey('raw', importData, importAlgorithm, extractable, keyUsages).then(function(importedKey) {
- results.importedKey = importedKey;
- importedKey.extraProperty = 'hi';
- return cloneKey(importedKey);
- }).then(function(result) {
- results.clonedKey = result;
-
- importedKey = results.importedKey;
- clonedKey = results.clonedKey;
-
- shouldEvaluateAs("importedKey.extraProperty", "hi");
- shouldEvaluateAs("importedKey.type", "secret");
- shouldEvaluateAs("importedKey.extractable", extractable);
- shouldEvaluateAs("importedKey.algorithm.name", "HKDF");
- shouldEvaluateAs("importedKey.usages.join(',')", keyUsages.join(","));
-
- shouldNotBe("importedKey", "clonedKey");
-
- shouldBeUndefined("clonedKey.extraProperty");
- shouldEvaluateAs("clonedKey.type", "secret");
- shouldEvaluateAs("clonedKey.extractable", extractable);
- shouldEvaluateAs("clonedKey.algorithm.name", "HKDF");
- shouldEvaluateAs("clonedKey.usages.join(',')", keyUsages.join(","));
-
- logSerializedKey(importedKey);
-
- debug("");
- });
-}
-
-var lastPromise = Promise.resolve(null);
-
-kPossibleHashAlgorithms.forEach(function(hashName) {
- kPossibleKeyUsages.forEach(function(keyUsages) {
- kPossibleKeyData.forEach(function(keyData) {
- lastPromise = lastPromise.then(runTest.bind(null, hashName, keyUsages, keyData));
- });
- });
-});
-
-lastPromise.then(finishJSTest, failAndFinishJSTest);
-
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/crypto/subtle/clone-ecKey-public-expected.txt ('k') | LayoutTests/crypto/subtle/clone-hkdfKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698