2 function clickHandler(errors, warnings)
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));
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) {
31 var button = document.createElement("button");
33 if (!test.errors && !test.warnings)
34 content = "(nothing)";
37 content += test.errors + " error" + (test.errors != 1 ? "s" : "");
38 if (test.warnings > 0) {
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);
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>