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

Unified Diff: LayoutTests/crypto/subtle/hkdf-importKey-failures.html

Issue 822083003: Webcrypto: add layout tests for HKDF algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove duplicate test case Created 5 years, 11 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/hkdf-importKey-failures.html
diff --git a/LayoutTests/crypto/subtle/hkdf-importKey-failures.html b/LayoutTests/crypto/subtle/hkdf-importKey-failures.html
new file mode 100644
index 0000000000000000000000000000000000000000..2f8bd568bca054f1494cbd7dfa6cc0443219406d
--- /dev/null
+++ b/LayoutTests/crypto/subtle/hkdf-importKey-failures.html
@@ -0,0 +1,50 @@
+<!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 inputs to HKDF importKey()");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+rawBytes = new Uint8Array([1, 2]);
+
+var p = Promise.resolve(null);
+p.then(function() {
+ debug("\nimportKey() with 'encrypt' usage...");
+ return crypto.subtle.importKey("raw", rawBytes, "HKDF", extractable, ['encrypt']);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ debug("\nimportKey() with null key data...");
+ return crypto.subtle.importKey("raw", null, "HKDF", extractable, ['deriveKey']);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ debug("\nimportKey() with jwk format...");
+ return crypto.subtle.importKey("jwk", {kty: "HKDF"}, "HKDF", extractable, ['deriveKey']);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ debug("\nimportKey() with spki format...");
+ return crypto.subtle.importKey("spki", rawBytes, "HKDF", extractable, ['deriveKey']);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ debug("\nimportKey() with empty usages...");
+ return crypto.subtle.importKey("raw", rawBytes, "HKDF", extractable, []);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+}).then(finishJSTest, failAndFinishJSTest);
+
+</script>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/crypto/subtle/hkdf-exportKey-expected.txt ('k') | LayoutTests/crypto/subtle/hkdf-importKey-failures-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698