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

Unified Diff: LayoutTests/crypto/importKey.html

Issue 198513002: [webcrypto] Make the import algorithm a required parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « no previous file | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/importKey.html
diff --git a/LayoutTests/crypto/importKey.html b/LayoutTests/crypto/importKey.html
index a7481ccdd286bfbbcf57b209221c9045cb816d90..fcdc3e24447427abc30821367f59df75c953b880 100644
--- a/LayoutTests/crypto/importKey.html
+++ b/LayoutTests/crypto/importKey.html
@@ -112,17 +112,6 @@ Promise.resolve(null).then(function() {
bytesShouldMatchHexString("key.algorithm.publicExponent", "010001", key.algorithm.publicExponent);
shouldBe("key.usages.join(',')", "''")
- // Import a "raw" key without specifying the algorithm.
- keyFormat = "raw";
- data = asciiToUint8Array("16 bytes of key!");
- algorithm = null;
- extractable = false;
- keyUsages = [];
-
- return crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyUsages);
-}).then(undefined, function(result) {
- debug("rejected with " + result);
-
keyFormat = "raw";
data = asciiToUint8Array("");
algorithm = aesCbc;
@@ -147,6 +136,9 @@ Promise.resolve(null).then(function() {
shouldThrow("crypto.subtle.importKey(keyFormat, [], algorithm, extractable, keyUsages)");
shouldThrow("crypto.subtle.importKey(keyFormat, null, algorithm, extractable, keyUsages)");
+ // Invalid algorithm
+ shouldThrow("crypto.subtle.importKey(keyFormat, data, null, extractable, keyUsages)");
+
// Missing hash parameter for HMAC.
shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'hmac'}, extractable, keyUsages)");
« no previous file with comments | « no previous file | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698