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

Side by Side Diff: LayoutTests/crypto/digest-failures.html

Issue 206483010: [webcrypto] Refactor some layout tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/digest-expected.txt ('k') | LayoutTests/crypto/digest-failures-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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10
11 <script>
12 description("Tests incorrect calls to crypto.subtle.digest()");
13
14 jsTestIsAsync = true;
15
16 // Pass invalid data to digest()
17 shouldThrow("crypto.subtle.digest({name: 'sha-1'})");
18 shouldThrow("crypto.subtle.digest({name: 'sha-1'}, null)");
19 shouldThrow("crypto.subtle.digest({name: 'sha-1'}, 10)");
20
21 // Pass invalid algorithmIdentifiers to digest()
22 data = new Uint8Array([0]);
23 shouldThrow("crypto.subtle.digest(null, data)");
24
25 Promise.resolve(null).then(function(result) {
26 // "sha" is not a recognized algorithm name
27 return crypto.subtle.digest({name: 'sha'}, data);
28 }).then(failAndFinishJSTest, function(result) {
29 error = result;
30 shouldBeNull("error");
31
32 // Algorithm lacks a name.
33 return crypto.subtle.digest({}, data);
34 }).then(failAndFinishJSTest, function(result) {
35 error = result;
36 shouldBeNull("error");
37
38 }).then(finishJSTest, failAndFinishJSTest);
39
40 </script>
41
42 </body>
43 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/digest-expected.txt ('k') | LayoutTests/crypto/digest-failures-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698