Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / inspector / console-assert.html
blobdf2c4cc05a04c4d28b4a3e468dd3bd9c65d6571d
1 <script>
2 function createClickHandler(result, str) {
3 return function() {
4 console.assert(result, "%s", str);
8 function load() {
9 var tests = [
10 "",
11 "false",
12 "null",
13 "document.body",
14 "!document.body",
15 "true"
18 for (var i = 0; i < tests.length; ++i) {
19 var test = tests[i];
20 var result;
21 try {
22 result = eval(test);
23 } catch(e) {
24 result = false;
26 var button = document.createElement("button");
27 button.innerText = "console.assert(" + test + "): should" + (result ? " not" : "") + " assert";
28 button.onclick = createClickHandler(result, test);
29 var p = document.createElement("p");
30 p.appendChild(button);
31 document.body.appendChild(p);
34 </script>
35 <body onload="load()">
36 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19134">Bug 19134: Inspector should support console.assert</a>.</p>
37 <p>To test, click the buttons below and look at the Inspector's Console.</p>