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

Side by Side Diff: LayoutTests/crypto/sign-verify-badParameters.html

Issue 243853004: [webcrypto] Reject failed operations with a DOMException rather than null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile warning Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script> 5 <script src="resources/common.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 data = asciiToUint8Array("hello"); 26 data = asciiToUint8Array("hello");
27 hmac = {name: 'HMAC', hash: {name: 'sha-1'}}; 27 hmac = {name: 'HMAC', hash: {name: 'sha-1'}};
28 28
29 importHmacKey().then(function(result) { 29 importHmacKey().then(function(result) {
30 key = result; 30 key = result;
31 31
32 // Pass invalid signature parameters to verify() 32 // Pass invalid signature parameters to verify()
33 return crypto.subtle.verify(hmac, key, null, data); 33 return crypto.subtle.verify(hmac, key, null, data);
34 }).then(failAndFinishJSTest, function(result) { 34 }).then(failAndFinishJSTest, function(result) {
35 error = result; 35 logError(result);
36 shouldBeNull("error");
37 36
38 // Pass invalid signature parameters to verify() 37 // Pass invalid signature parameters to verify()
39 return crypto.subtle.verify(hmac, key, 'a', data); 38 return crypto.subtle.verify(hmac, key, 'a', data);
40 }).then(failAndFinishJSTest, function(result) { 39 }).then(failAndFinishJSTest, function(result) {
41 error = result; 40 logError(result);
42 shouldBeNull("error");
43 41
44 // Pass invalid signature parameters to verify() 42 // Pass invalid signature parameters to verify()
45 return crypto.subtle.verify(hmac, key, [], data); 43 return crypto.subtle.verify(hmac, key, [], data);
46 }).then(failAndFinishJSTest, function(result) { 44 }).then(failAndFinishJSTest, function(result) {
47 error = result; 45 logError(result);
48 shouldBeNull("error");
49 46
50 // Operation does not support signing. 47 // Operation does not support signing.
51 return crypto.subtle.sign({name: 'sha-1'}, key, data); 48 return crypto.subtle.sign({name: 'sha-1'}, key, data);
52 }).then(failAndFinishJSTest, function(result) { 49 }).then(failAndFinishJSTest, function(result) {
53 error = result; 50 logError(result);
54 shouldBeNull("error");
55 51
56 // Operation doesn't support signing (also given an invalid key, but the 52 // Operation doesn't support signing (also given an invalid key, but the
57 // first failure takes priority) 53 // first failure takes priority)
58 return crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, key, data); 54 return crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, key, data);
59 }).then(failAndFinishJSTest, function(result) { 55 }).then(failAndFinishJSTest, function(result) {
60 error = result; 56 logError(result);
61 shouldBeNull("error");
62 }).then(finishJSTest, failAndFinishJSTest); 57 }).then(finishJSTest, failAndFinishJSTest);
63 58
64 </script> 59 </script>
65 60
66 </body> 61 </body>
67 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698