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

Side by Side Diff: LayoutTests/crypto/digest-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 incorrect calls to crypto.subtle.digest()"); 12 description("Tests incorrect calls to crypto.subtle.digest()");
13 13
14 jsTestIsAsync = true; 14 jsTestIsAsync = true;
15 15
16 // Called with too few parameters. 16 Promise.resolve(null).then(function(result) {
17 shouldThrow("crypto.subtle.digest({name: 'sha-1'})"); 17 // Called with too few parameters.
18 return crypto.subtle.digest({name: 'sha-1'});
19 }).then(failAndFinishJSTest, function(result) {
20 error = result;
21 shouldBeTypeError("error");
18 22
19 Promise.resolve(null).then(function(result) {
20 // "null" is not a valid data argument. 23 // "null" is not a valid data argument.
21 return crypto.subtle.digest({name: 'sha-1'}, null); 24 return crypto.subtle.digest({name: 'sha-1'}, null);
22 }).then(failAndFinishJSTest, function(result) { 25 }).then(failAndFinishJSTest, function(result) {
23 error = result; 26 error = result;
24 shouldBeNull("error"); 27 shouldBeNull("error");
25 28
26 // 10 is not a valid data argument. 29 // 10 is not a valid data argument.
27 return crypto.subtle.digest({name: 'sha-1'}, 10); 30 return crypto.subtle.digest({name: 'sha-1'}, 10);
28 }).then(failAndFinishJSTest, function(result) { 31 }).then(failAndFinishJSTest, function(result) {
29 error = result; 32 error = result;
(...skipping 17 matching lines...) Expand all
47 }).then(failAndFinishJSTest, function(result) { 50 }).then(failAndFinishJSTest, function(result) {
48 error = result; 51 error = result;
49 shouldBeNull("error"); 52 shouldBeNull("error");
50 53
51 }).then(finishJSTest, failAndFinishJSTest); 54 }).then(finishJSTest, failAndFinishJSTest);
52 55
53 </script> 56 </script>
54 57
55 </body> 58 </body>
56 </html> 59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698