Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / crypto / subtle / digest-failures.html
blob108a94d155113dc4e0c13d0adde874c25da7fd7d
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>
11 <script>
12 description("Tests incorrect calls to crypto.subtle.digest()");
14 jsTestIsAsync = true;
16 Promise.resolve(null).then(function(result) {
18 debug("\ndigest() without data argument...");
19 return crypto.subtle.digest({name: 'sha-1'});
20 }).then(failAndFinishJSTest, function(result) {
21 logError(result);
23 debug("\ndigest() with data argument that is null...");
24 return crypto.subtle.digest({name: 'sha-1'}, null);
25 }).then(failAndFinishJSTest, function(result) {
26 logError(result);
28 debug("\ndigest() with data argument that is an integer...");
29 return crypto.subtle.digest({name: 'sha-1'}, 10);
30 }).then(failAndFinishJSTest, function(result) {
31 logError(result);
33 data = new Uint8Array([0]);
34 debug("\ndigest() with algorithm as null...");
35 return crypto.subtle.digest(null, data);
36 }).then(failAndFinishJSTest, function(result) {
37 logError(result);
39 debug("\ndigest() with invalid agorithm that is sha...");
40 return crypto.subtle.digest({name: 'sha'}, data);
41 }).then(failAndFinishJSTest, function(result) {
42 logError(result);
44 debug("\ndigest() without algorithm name...");
45 return crypto.subtle.digest({}, data);
46 }).then(failAndFinishJSTest, function(result) {
47 logError(result);
49 }).then(finishJSTest, failAndFinishJSTest);
51 </script>
53 </body>
54 </html>