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

Side by Side Diff: LayoutTests/crypto/aes-cbc-generateKey-parseAlgorithm-failures.html

Issue 240063002: [webcrypto] Update layout tests to match idl generator changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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-CBC parameters."); 12 description("Tests generateKey() with bad AES-CBC parameters.");
13 jsTestIsAsync = true; 13 jsTestIsAsync = true;
14 14
15 extractable = true; 15 extractable = true;
16 keyUsages = ['encrypt', 'decrypt']; 16 keyUsages = ['encrypt', 'decrypt'];
17 17
18 // Invalid keyUsages 18 Promise.resolve(null).then(function() {
19 shouldThrow("crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extrac table, -1)"); 19 // Invalid keyUsages
20 shouldThrow("crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extrac table, null)"); 20 return crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extracta ble, -1);
21 }).then(failAndFinishJSTest, function(result) {
22 error = result
23 shouldBeTypeError("error");
21 24
22 Promise.resolve(null).then(function() { 25 // Invalid keyUsages
26 return crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extracta ble, null);
27 }).then(failAndFinishJSTest, function(result) {
28 error = result
29 shouldBeTypeError("error");
30
23 // Bad key usage "boo". 31 // Bad key usage "boo".
24 return crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extracta ble, ['boo']); 32 return crypto.subtle.generateKey({ name: 'aes-cbc', length: 1024 }, extracta ble, ['boo']);
25 }).then(failAndFinishJSTest, function(result) { 33 }).then(failAndFinishJSTest, function(result) {
26 error = result; 34 error = result;
27 shouldBeNull("error"); 35 shouldBeNull("error");
28 36
29 return crypto.subtle.generateKey({ name: 'aes-cbc' }, extractable, keyUsages ); 37 return crypto.subtle.generateKey({ name: 'aes-cbc' }, extractable, keyUsages );
30 }).then(failAndFinishJSTest, function(result) { 38 }).then(failAndFinishJSTest, function(result) {
31 error = result; 39 error = result;
32 shouldBeNull("error"); 40 shouldBeNull("error");
(...skipping 11 matching lines...) Expand all
44 return crypto.subtle.generateKey({ name: 'aes-cbc', length: -Infinity }, ext ractable, keyUsages); 52 return crypto.subtle.generateKey({ name: 'aes-cbc', length: -Infinity }, ext ractable, keyUsages);
45 }).then(failAndFinishJSTest, function(result) { 53 }).then(failAndFinishJSTest, function(result) {
46 error = result; 54 error = result;
47 shouldBeNull("error"); 55 shouldBeNull("error");
48 }).then(finishJSTest, failAndFinishJSTest); 56 }).then(finishJSTest, failAndFinishJSTest);
49 57
50 </script> 58 </script>
51 59
52 </body> 60 </body>
53 </html> 61 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/crypto/aes-cbc-generateKey-parseAlgorithm-failures-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698