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

Unified Diff: LayoutTests/crypto/aes-export-key.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/aes-export-key.html
diff --git a/LayoutTests/crypto/aes-export-key.html b/LayoutTests/crypto/aes-export-key.html
deleted file mode 100644
index e4e170102d2053f52325caeba9796efca874ff32..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/aes-export-key.html
+++ /dev/null
@@ -1,107 +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 exporting an AES key.");
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
- kty: "oct",
- k: "jnOw99oOZFLIEPMrgJB55WL46tJSLGt7jnOw99oOZFI"
-};
-
-Promise.resolve(null).then(function(result) {
- return crypto.subtle.exportKey("raw");
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("raw", null)
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("raw", undefined);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("raw", {});
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("raw", 1);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- debug("\nImporting a JWK key...");
-
- return crypto.subtle.importKey("jwk", jwkKey, {name: "AES-CBC"}, extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']);
-}).then(function(result) {
- key = result;
-
- return crypto.subtle.exportKey(null, key);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey(undefined, key);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey({}, key);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("", key);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
- return crypto.subtle.exportKey("foobar", key);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
-
- debug("\nExporting the key as raw data...");
- return crypto.subtle.exportKey("raw", key);
-}).then(function(result) {
- exportedData = result;
- shouldBe("bytesToHexString(new Uint8Array(exportedData))", "'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b8e73b0f7da0e6452'");
-
- debug("Exporting the key as JWK...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- exportedJWK = result;
- shouldBe("exportedJWK.kty", "'oct'");
- shouldBe("exportedJWK.k", "'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7jnOw99oOZFI'");
- shouldBe("exportedJWK.alg", "'A256CBC'");
- shouldBe("exportedJWK.ext", "true");
- shouldBe("exportedJWK.use", "undefined");
- shouldBe("exportedJWK.key_ops", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
-
- debug("\nImporting a key that's not extractable...");
- return crypto.subtle.importKey("jwk", jwkKey, {name: "AES-CBC"}, nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
-}).then(function(result) {
- key = result;
-
- debug("\nTrying to export as raw...");
- return crypto.subtle.exportKey("raw", key);
-}, failAndFinishJSTest).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function(result) {
- testPassed("Rejected, as expected");
- logError(result);
-
- debug("Trying to export as jwk...");
- return crypto.subtle.exportKey("jwk", key);
-}).then(function(result) {
- testFailed("Promise wasn't rejected");
- finishJSTest();
-}, function(result) {
- testPassed("Rejected, as expected");
- logError(result);
-
- finishJSTest();
-});
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/crypto/aes-ctr-parseAlgorithm-failures-expected.txt ('k') | LayoutTests/crypto/aes-export-key-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698