Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / inspector / error-warning-count.html
blob9f6b9c23fcfc36bc793ad12b63e811840a2f170d
1 <script>
2 function clickHandler(errors, warnings)
4 return function()
6 for (var i = 0; i < errors; ++i)
7 console.error("Error " + (i + 1));
8 for (var i = 0; i < warnings; ++i)
9 console.warn("Warning " + (i + 1));
13 function loaded()
15 var tests = [
16 { errors: 0, warnings: 0 },
17 { errors: 1, warnings: 0 },
18 { errors: 2, warnings: 0 },
19 { errors: 0, warnings: 1 },
20 { errors: 0, warnings: 2 },
21 { errors: 1, warnings: 1 },
22 { errors: 1, warnings: 2 },
23 { errors: 2, warnings: 1 },
24 { errors: 2, warnings: 2 },
25 { errors: 100, warnings: 100 },
28 for (var i in tests) {
29 var test = tests[i];
31 var button = document.createElement("button");
32 var content = "";
33 if (!test.errors && !test.warnings)
34 content = "(nothing)";
35 else {
36 if (test.errors > 0)
37 content += test.errors + " error" + (test.errors != 1 ? "s" : "");
38 if (test.warnings > 0) {
39 if (content.length)
40 content += ", ";
41 content += test.warnings + " warning" + (test.warnings != 1 ? "s" : "")
44 button.innerText = content;
45 button.onclick = clickHandler(test.errors, test.warnings);
46 var p = document.createElement("p");
47 p.appendChild(button);
48 document.body.appendChild(p);
51 </script>
52 <body onload="loaded()">
53 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=18650">Bug 18650:
54 Errors/warnings in Inspector should be visible outside of Resources</a>.</p>
55 <p>To test, open the Inspector and click one of the buttons below. You should
56 see an error and/or warning count in the Inspector's status bar. Clicking on
57 the error/warning count should open the Console. Hovering over the
58 error/warning count should show you a tooltip that matches the text in the
59 button you clicked.</p>
60 <p>Note: You must reload the page between each button press.</p>