OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="console-test.js"></script> | 3 <script src="console-test.js"></script> |
4 <script src="inspector-test.js"></script> | 4 <script src="inspector-test.js"></script> |
5 <script> | 5 <script> |
6 console.log("message from page!"); | 6 console.log("message from page!"); |
7 | 7 |
8 function test() | 8 function test() |
9 { | 9 { |
10 var checkbox = Console.ConsoleView.instance()._filter._filterByExecutionCont
extCheckbox.inputElement; | 10 var filterByExecutionContextSetting = Console.ConsoleView.instance()._filter
._filterByExecutionContextSetting; |
11 | 11 |
12 //we can't use usual InspectorTest.dumpConsoleMessages(), because it dumps u
rl of message and it flakes in case of iframe | 12 //we can't use usual InspectorTest.dumpConsoleMessages(), because it dumps u
rl of message and it flakes in case of iframe |
13 function dumpVisibleConsoleMessageText() | 13 function dumpVisibleConsoleMessageText() |
14 { | 14 { |
15 var messageViews = Console.ConsoleView.instance()._visibleViewMessages; | 15 var messageViews = Console.ConsoleView.instance()._visibleViewMessages; |
16 for (var i = 0; i < messageViews.length; ++i) { | 16 for (var i = 0; i < messageViews.length; ++i) { |
17 InspectorTest.addResult(messageViews[i].consoleMessage().messageText
); | 17 InspectorTest.addResult(messageViews[i].consoleMessage().messageText
); |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 InspectorTest.runTestSuite([ | 21 InspectorTest.runTestSuite([ |
22 | 22 |
23 function testInitialState(next) | 23 function testInitialState(next) |
24 { | 24 { |
25 if (checkbox.checked) | 25 if (filterByExecutionContextSetting.get()) |
26 InspectorTest.addResult("\"Show target messages\" checkbox s
hould be unchecked by default"); | 26 InspectorTest.addResult("\"Show target messages\" checkbox s
hould be unchecked by default"); |
27 dumpVisibleConsoleMessageText(); | 27 dumpVisibleConsoleMessageText(); |
28 next(); | 28 next(); |
29 }, | 29 }, |
30 | 30 |
31 function testPageOnlyMessages(next) | 31 function testPageOnlyMessages(next) |
32 { | 32 { |
33 InspectorTest.changeExecutionContext("top"); | 33 InspectorTest.changeExecutionContext("top"); |
34 checkbox.click(); | 34 filterByExecutionContextSetting.set(true); |
35 dumpVisibleConsoleMessageText(); | 35 dumpVisibleConsoleMessageText(); |
36 next(); | 36 next(); |
37 }, | 37 }, |
38 | 38 |
39 function testFrameOnlyMessages(next) | 39 function testFrameOnlyMessages(next) |
40 { | 40 { |
41 InspectorTest.changeExecutionContext("myIFrame"); | 41 InspectorTest.changeExecutionContext("myIFrame"); |
42 dumpVisibleConsoleMessageText(); | 42 dumpVisibleConsoleMessageText(); |
43 next(); | 43 next(); |
44 }, | 44 }, |
45 | 45 |
46 function testAllMessagesWithFrameContext(next) | 46 function testAllMessagesWithFrameContext(next) |
47 { | 47 { |
48 checkbox.click(); | 48 filterByExecutionContextSetting.set(false); |
49 dumpVisibleConsoleMessageText(); | 49 dumpVisibleConsoleMessageText(); |
50 next(); | 50 next(); |
51 } | 51 } |
52 ]); | 52 ]); |
53 } | 53 } |
54 | 54 |
55 </script> | 55 </script> |
56 </head> | 56 </head> |
57 | 57 |
58 <body> | 58 <body> |
59 <p> | 59 <p> |
60 Tests that console shows messages only from specific context when show target ch
eckbox is checked.</a> | 60 Tests that console shows messages only from specific context when show target ch
eckbox is checked.</a> |
61 </p> | 61 </p> |
62 <iframe name="myIFrame" src="resources/console-show-all-messages-iframe.html" on
load="runTest()"></iframe> | 62 <iframe name="myIFrame" src="resources/console-show-all-messages-iframe.html" on
load="runTest()"></iframe> |
63 | 63 |
64 </body> | 64 </body> |
65 </html> | 65 </html> |
OLD | NEW |