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

Unified Diff: LayoutTests/crypto/generateKey.html

Issue 23361019: WebCrypto: properly normalize optional numeric parameters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Replace contains() with a different get() method Created 7 years, 4 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/generateKey-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/generateKey.html
diff --git a/LayoutTests/crypto/generateKey.html b/LayoutTests/crypto/generateKey.html
index 209d3b34fcfeb36403efaf0fdfc75496e35b8836..fd2a424c0934a4db581b86081cb530d35b0c580c 100644
--- a/LayoutTests/crypto/generateKey.html
+++ b/LayoutTests/crypto/generateKey.html
@@ -39,9 +39,16 @@ shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: ''}, length: 48}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: 5000000000}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: NaN}, extractable , keyUsages)");
-shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: -NaN}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: Infinity}, extractable , keyUsages)");
shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: -Infinity}, extractable , keyUsages)");
+shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: crypto}, extractable , keyUsages)");
+shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: undefined}, extractable , keyUsages)");
+
+// The length property doesn't strictly need to be a number according to WebIDL.
+// It just has to be convertable with ToNumber().
+shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: '48'}, extractable , keyUsages)");
+shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: null}, extractable , keyUsages)");
+shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, length: true}, extractable , keyUsages)");
// ---------------------------------------------------
// RSASSA-PKCS1-v1_5 normalization failures (RsaKeyGenParams)
« no previous file with comments | « no previous file | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698