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

Side by Side Diff: LayoutTests/crypto/aes-kw-generateKey-parseAlgorithm-failures.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
11 <script> 11 <script>
12 description("Tests generateKey() with bad AES-KW parameters."); 12 description("Tests generateKey() with bad AES-KW parameters.");
13 jsTestIsAsync = true; 13 jsTestIsAsync = true;
14 14
15 extractable = true; 15 extractable = true;
16 keyUsages = ['wrapKey', 'unwrapKey']; 16 keyUsages = ['wrapKey', 'unwrapKey'];
17 17
18 Promise.resolve(null).then(function() { 18 Promise.resolve(null).then(function() {
19 return crypto.subtle.generateKey({ name: 'aes-kw' }, extractable, keyUsages) ; 19 return crypto.subtle.generateKey({ name: 'aes-kw' }, extractable, keyUsages) ;
20 }).then(failAndFinishJSTest, function(result) { 20 }).then(failAndFinishJSTest, function(result) {
21 error = result; 21 logError(result);
22 shouldBeNull("error");
23 22
24 return crypto.subtle.generateKey({ name: 'aes-kw', length: 70000 }, extracta ble, keyUsages); 23 return crypto.subtle.generateKey({ name: 'aes-kw', length: 70000 }, extracta ble, keyUsages);
25 }).then(failAndFinishJSTest, function(result) { 24 }).then(failAndFinishJSTest, function(result) {
26 error = result; 25 logError(result);
27 shouldBeNull("error");
28 26
29 return crypto.subtle.generateKey({ name: 'aes-kw', length: -3 }, extractable , keyUsages); 27 return crypto.subtle.generateKey({ name: 'aes-kw', length: -3 }, extractable , keyUsages);
30 }).then(failAndFinishJSTest, function(result) { 28 }).then(failAndFinishJSTest, function(result) {
31 error = result; 29 logError(result);
32 shouldBeNull("error");
33 30
34 return crypto.subtle.generateKey({ name: 'aes-kw', length: -Infinity }, extr actable, keyUsages); 31 return crypto.subtle.generateKey({ name: 'aes-kw', length: -Infinity }, extr actable, keyUsages);
35 }).then(failAndFinishJSTest, function(result) { 32 }).then(failAndFinishJSTest, function(result) {
36 error = result; 33 logError(result);
37 shouldBeNull("error");
38 }).then(finishJSTest, failAndFinishJSTest); 34 }).then(finishJSTest, failAndFinishJSTest);
39 35
40 </script> 36 </script>
41 37
42 </body> 38 </body>
43 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698