3 <script src=
"console-test.js"></script>
4 <script src=
"inspector-test.js"></script>
6 console
.log("message from page!");
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();
31 function testPageOnlyMessages(next
)
34 dumpVisibleConsoleMessageText();
38 function testFrameOnlyMessages(next
)
40 InspectorTest
.changeExecutionContext("myIFrame");
41 dumpVisibleConsoleMessageText();
45 function testAllMessagesWithFrameContext(next
)
48 dumpVisibleConsoleMessageText();
59 Tests that console shows messages only from specific context when show all checkbox is unchecked.
</a>
61 <iframe name=
"myIFrame" src=
"resources/console-show-all-messages-iframe.html" onload=
"runTest()"></iframe>