OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
5 <script src="../../../http/tests/inspector/network-test.js"></script> | 5 <script src="../../../http/tests/inspector/network-test.js"></script> |
6 <script src="../../../http/tests/inspector/resources-test.js"></script> | 6 <script src="../../../http/tests/inspector/resources-test.js"></script> |
7 | |
8 <script> | 7 <script> |
9 | |
10 function addErrorToConsole() | 8 function addErrorToConsole() |
11 { | 9 { |
12 console.error("test error message"); | 10 console.error("test error message"); |
13 } | 11 } |
14 | 12 |
15 function methodForBreakpoint() | 13 function methodForBreakpoint() |
16 { | 14 { |
17 alert("Hello world"); | 15 alert("Hello world"); |
18 } | 16 } |
19 | 17 |
(...skipping 21 matching lines...) Expand all Loading... |
41 | 39 |
42 function testConsoleMessage(next) | 40 function testConsoleMessage(next) |
43 { | 41 { |
44 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou
rce); | 42 InspectorTest.showScriptSource("source-frame.html", didShowScriptSou
rce); |
45 | 43 |
46 var shownSourceFrame; | 44 var shownSourceFrame; |
47 function didShowScriptSource(sourceFrame) | 45 function didShowScriptSource(sourceFrame) |
48 { | 46 { |
49 InspectorTest.addResult("Script source was shown."); | 47 InspectorTest.addResult("Script source was shown."); |
50 shownSourceFrame = sourceFrame; | 48 shownSourceFrame = sourceFrame; |
51 InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototyp
e, "addMessageToSource", didAddMessage); | 49 InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototyp
e, "_addMessageToSource", didAddMessage); |
52 InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototyp
e, "clearMessages", clearMessages); | 50 InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototyp
e, "_removeMessageFromSource", didRemoveMessage); |
53 InspectorTest.evaluateInPage("addErrorToConsole()"); | 51 InspectorTest.evaluateInPage("addErrorToConsole()"); |
54 } | 52 } |
55 | 53 |
56 function didAddMessage(message) | 54 function didAddMessage(message) |
57 { | 55 { |
58 if (this !== shownSourceFrame) | 56 if (this !== shownSourceFrame) |
59 return; | 57 return; |
60 InspectorTest.addResult("Message added to source frame: " + mess
age.text()); | 58 InspectorTest.addResult("Message added to source frame: " + mess
age.text()); |
61 InspectorTest.consoleModel.requestClearMessages(); | 59 setImmediate(function() { InspectorTest.consoleModel.requestClea
rMessages(); }); |
62 } | 60 } |
63 | 61 |
64 function clearMessages() | 62 function didRemoveMessage(message) |
65 { | 63 { |
66 if (this !== shownSourceFrame) | 64 if (this !== shownSourceFrame) |
67 return; | 65 return; |
68 InspectorTest.addResult("Messages cleared in source frame."); | 66 InspectorTest.addResult("Message removed from source frame: " +
message.text()); |
69 next(); | 67 next(); |
70 } | 68 } |
71 }, | 69 }, |
72 | 70 |
73 function testShowResource(next) | 71 function testShowResource(next) |
74 { | 72 { |
75 WebInspector.NetworkPanel.show(); | 73 WebInspector.NetworkPanel.show(); |
76 | 74 |
77 InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "show",
didShowSourceFrame); | 75 InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "show",
didShowSourceFrame); |
78 | 76 |
(...skipping 18 matching lines...) Expand all Loading... |
97 | 95 |
98 </head> | 96 </head> |
99 | 97 |
100 <body onload="runTest()"> | 98 <body onload="runTest()"> |
101 <p>Tests that it's possible to set breakpoint in source frame, and that | 99 <p>Tests that it's possible to set breakpoint in source frame, and that |
102 source frame displays breakpoints and console errors. | 100 source frame displays breakpoints and console errors. |
103 </p> | 101 </p> |
104 | 102 |
105 </body> | 103 </body> |
106 </html> | 104 </html> |
OLD | NEW |