Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / inspector / console-show-all-messages.html
blobc00830cc46cf163fb99c93608d7116daedc4e87c
1 <html>
2 <head>
3 <script src="console-test.js"></script>
4 <script src="inspector-test.js"></script>
5 <script>
6 console.log("message from page!");
8 function test()
10 var checkbox = WebInspector.ConsolePanel._view()._showAllMessagesCheckbox.inputElement;
12 //we can't use usual InspectorTest.dumpConsoleMessages(), because it dumps url of message and it flakes in case of iframe
13 function dumpVisibleConsoleMessageText()
15 var messageViews = WebInspector.ConsolePanel._view()._visibleViewMessages;
16 for (var i = 0; i < messageViews.length; ++i) {
17 InspectorTest.addResult(messageViews[i].consoleMessage().messageText);
21 InspectorTest.runTestSuite([
23 function testInitialState(next)
25 if (!checkbox.checked)
26 InspectorTest.addResult("\"Show all messages\" checkbox should be checked by default");
27 dumpVisibleConsoleMessageText();
28 next();
31 function testPageOnlyMessages(next)
33 checkbox.click();
34 dumpVisibleConsoleMessageText();
35 next();
38 function testFrameOnlyMessages(next)
40 InspectorTest.changeExecutionContext("myIFrame");
41 dumpVisibleConsoleMessageText();
42 next();
45 function testAllMessagesWithFrameContext(next)
47 checkbox.click();
48 dumpVisibleConsoleMessageText();
49 next();
51 ]);
54 </script>
55 </head>
57 <body>
58 <p>
59 Tests that console shows messages only from specific context when show all checkbox is unchecked.</a>
60 </p>
61 <iframe name="myIFrame" src="resources/console-show-all-messages-iframe.html" onload="runTest()"></iframe>
63 </body>
64 </html>