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

Unified Diff: LayoutTests/crypto/import-aes-key-bad-length.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/import-aes-key-bad-length.html
diff --git a/LayoutTests/crypto/import-aes-key-bad-length.html b/LayoutTests/crypto/import-aes-key-bad-length.html
deleted file mode 100644
index e9455d6dbc40671418a5b38724d3f6324072bfd2..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/import-aes-key-bad-length.html
+++ /dev/null
@@ -1,59 +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 importing an AES key from raw with wrong length");
-
-jsTestIsAsync = true;
-
-// -------------------------------------------------
-// Failed key import.
-// -------------------------------------------------
-
-// Supported key lengths are 16 (128-bit), 32 (256-bit), 24 (192-bit),
-// Try key lengths that are off by 1 from the supported ones.
-var kUnsupportedKeyLengths = [
- 0, 1, 15, 17, 31, 33, 23, 25, 64
-];
-
-// Not exhaustive
-var kAesAlgorithms = [
- "AES-CBC", "AES-GCM", "AES-KW"
-];
-
-function testInvalidKeyImport(algorithmName, keyLengthBytes)
-{
- var algorithm = {name: algorithmName};
- var keyData = new Uint8Array(keyLengthBytes);
-
- var usages = ['encrypt', 'decrypt'];
- var extractable = false;
-
- return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages).then(function(result) {
- debug("FAIL: Successfully imported " + algorithmName + " key of length " + keyData.byteLength + " bytes");
- }, function(result) {
- debug("PASS: Failed to import " + algorithmName + " key of length " + keyData.byteLength + " bytes");
- });
-}
-
-var lastPromise = Promise.resolve(null);
-
-kAesAlgorithms.forEach(function(algorithmName) {
- kUnsupportedKeyLengths.forEach(function(keyLengthBytes) {
- lastPromise = lastPromise.then(testInvalidKeyImport.bind(null, algorithmName, keyLengthBytes));
- });
-});
-
-lastPromise.then(finishJSTest, failAndFinishJSTest);
-
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/crypto/hmac-sign-verify-expected.txt ('k') | LayoutTests/crypto/import-aes-key-bad-length-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698