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

Side by Side Diff: LayoutTests/crypto/importKey.html

Issue 170243007: [webcrypto] Make all of the crypto.subtle method failures asynchronous. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
« no previous file with comments | « LayoutTests/crypto/generateKey-expected.txt ('k') | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 }).then(undefined, function(result) { 84 }).then(undefined, function(result) {
85 debug("rejected with " + result); 85 debug("rejected with " + result);
86 86
87 keyFormat = "raw"; 87 keyFormat = "raw";
88 data = asciiToUint8Array(""); 88 data = asciiToUint8Array("");
89 algorithm = aesCbc; 89 algorithm = aesCbc;
90 extractable = true; 90 extractable = true;
91 keyUsages = []; 91 keyUsages = [];
92 92
93 // Invalid format. 93 // Invalid format.
94 shouldThrow("crypto.subtle.importKey('invalid format', data, algorithm, extr actable, keyUsages)"); 94 shouldRejectPromiseWithNull("crypto.subtle.importKey('invalid format', data, algorithm, extractable, keyUsages)");
95 95
96 // Invalid key usage. 96 // Invalid key usage.
97 shouldThrow("crypto.subtle.importKey(keyFormat, data, algorithm, extractable , ['SIGN'])"); 97 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, algori thm, extractable, ['SIGN'])");
98 98
99 // If both the format and key usage are bogus, should complain about the 99 // If both the format and key usage are bogus, should complain about the
100 // format first. 100 // format first.
101 shouldThrow("crypto.subtle.importKey('invalid format', data, algorithm, extr actable, ['SIGN'])"); 101 shouldRejectPromiseWithNull("crypto.subtle.importKey('invalid format', data, algorithm, extractable, ['SIGN'])");
102 102
103 // Undefined key usage. 103 // Undefined key usage.
104 // FIXME: http://crbug.com/262383 104 // FIXME: http://crbug.com/262383
105 //shouldThrow("crypto.subtle.importKey(keyFormat, data, algorithm, extractab le, undefined)"); 105 //shouldThrow("crypto.subtle.importKey(keyFormat, data, algorithm, extractab le, undefined)");
106 106
107 // Invalid data 107 // Invalid data
108 shouldThrow("crypto.subtle.importKey(keyFormat, [], algorithm, extractable, keyUsages)"); 108 shouldThrow("crypto.subtle.importKey(keyFormat, [], algorithm, extractable, keyUsages)");
109 shouldThrow("crypto.subtle.importKey(keyFormat, null, algorithm, extractable , keyUsages)"); 109 shouldThrow("crypto.subtle.importKey(keyFormat, null, algorithm, extractable , keyUsages)");
110 110
111 // Missing hash parameter for HMAC. 111 // Missing hash parameter for HMAC.
112 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'hmac'}, extractable, keyUsages)"); 112 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'hmac'}, extractable, keyUsages)");
113 113
114 // SHA-1 doesn't support the importKey operation. 114 // SHA-1 doesn't support the importKey operation.
115 shouldThrow("crypto.subtle.importKey(keyFormat, data, {name: 'sha-1'}, extra ctable, keyUsages)"); 115 shouldRejectPromiseWithNull("crypto.subtle.importKey(keyFormat, data, {name: 'sha-1'}, extractable, keyUsages)");
116 }).then(finishJSTest, failAndFinishJSTest); 116 }).then(finishJSTest, failAndFinishJSTest);
117 117
118 </script> 118 </script>
119 119
120 </body> 120 </body>
121 </html> 121 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/generateKey-expected.txt ('k') | LayoutTests/crypto/importKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698