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

Unified Diff: LayoutTests/crypto/aes-cbc-generate-key.html

Issue 298023002: [webcrypto] Import WebKit's webcrypto tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove FIXME for unrecognized jwk usages (supported now) Created 6 years, 6 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/aes-cbc-generate-key-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/aes-cbc-generate-key.html
diff --git a/LayoutTests/crypto/aes-cbc-generate-key.html b/LayoutTests/crypto/aes-cbc-generate-key.html
new file mode 100644
index 0000000000000000000000000000000000000000..2fb31b5f76dfc3ce660e4f633c87d722e2ae8133
--- /dev/null
+++ b/LayoutTests/crypto/aes-cbc-generate-key.html
@@ -0,0 +1,43 @@
+<!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 generating an AES key using AES-CBC algorithm.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+debug("Generating a key...");
+
+Promise.resolve(null).then(function(result) {
+ return crypto.subtle.generateKey({name: "aes-cbc"}, extractable, ["encrypt", "decrypt"]);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+ return crypto.subtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"]);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+ return crypto.subtle.generateKey({name: "aes-cbc", length: {}}, extractable, ["encrypt", "decrypt"]);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+ return crypto.subtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["encrypt", "decrypt"]);
+}).then(function(result) {
+ key = result;
+
+ shouldBe("key.type", "'secret'");
+ shouldBe("key.extractable", "true");
+ shouldBe("key.algorithm.name", "'AES-CBC'");
+ shouldBe("key.algorithm.length", "128");
+ shouldBe("key.usages", "['encrypt', 'decrypt']");
+}).then(finishJSTest, failAndFinishJSTest);
+</script>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/crypto/aes-cbc-generate-key-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698