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 | 5 |
6 <script> | 6 <script> |
7 function oneLineTestFunction() { return 0; } | 7 function oneLineTestFunction() { return 0; } |
8 </script> | 8 </script> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 13 matching lines...) Expand all Loading... |
24 InspectorTest.setQuiet(true); | 24 InspectorTest.setQuiet(true); |
25 InspectorTest.runDebuggerTestSuite([ | 25 InspectorTest.runDebuggerTestSuite([ |
26 function testSetBreakpoint(next) | 26 function testSetBreakpoint(next) |
27 { | 27 { |
28 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS
ource); | 28 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS
ource); |
29 | 29 |
30 function didShowScriptSource(sourceFrame) | 30 function didShowScriptSource(sourceFrame) |
31 { | 31 { |
32 currentSourceFrame = sourceFrame; | 32 currentSourceFrame = sourceFrame; |
33 InspectorTest.addResult("Script source was shown."); | 33 InspectorTest.addResult("Script source was shown."); |
34 InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true); | 34 setBreakpointAndWaitUntilPaused(currentSourceFrame, 16, didPause
); |
35 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | 35 InspectorTest.runTestFunction(); |
36 } | 36 } |
37 | 37 |
38 function didPause(callFrames) | 38 function didPause(callFrames) |
39 { | 39 { |
40 InspectorTest.addResult("Script execution paused."); | 40 InspectorTest.addResult("Script execution paused."); |
41 InspectorTest.captureStackTrace(callFrames); | 41 InspectorTest.captureStackTrace(callFrames); |
42 dumpBreakpointSidebarPane(); | 42 dumpBreakpointSidebarPane(); |
43 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD
ecoration", breakpointRemoved); | 43 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD
ecoration", breakpointRemoved); |
44 InspectorTest.removeBreakpoint(currentSourceFrame, 16); | 44 InspectorTest.removeBreakpoint(currentSourceFrame, 16); |
45 } | 45 } |
(...skipping 11 matching lines...) Expand all Loading... |
57 } | 57 } |
58 }, | 58 }, |
59 | 59 |
60 function testSetBreakpointOnTheLastLine(next) | 60 function testSetBreakpointOnTheLastLine(next) |
61 { | 61 { |
62 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS
ource); | 62 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS
ource); |
63 | 63 |
64 function didShowScriptSource(sourceFrame) | 64 function didShowScriptSource(sourceFrame) |
65 { | 65 { |
66 currentSourceFrame = sourceFrame; | 66 currentSourceFrame = sourceFrame; |
67 InspectorTest.setBreakpoint(currentSourceFrame, 6, "", true); | 67 setBreakpointAndWaitUntilPaused(currentSourceFrame, 6, didPause)
; |
68 InspectorTest.waitUntilPaused(didPause); | |
69 InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction, 0)
"); | 68 InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction, 0)
"); |
70 } | 69 } |
71 | 70 |
72 function didPause(callFrames) | 71 function didPause(callFrames) |
73 { | 72 { |
74 InspectorTest.captureStackTrace(callFrames); | 73 InspectorTest.captureStackTrace(callFrames); |
75 InspectorTest.removeBreakpoint(currentSourceFrame, 6); | 74 InspectorTest.removeBreakpoint(currentSourceFrame, 6); |
76 InspectorTest.resumeExecution(next); | 75 InspectorTest.resumeExecution(next); |
77 } | 76 } |
78 }, | 77 }, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 116 } |
118 ]); | 117 ]); |
119 | 118 |
120 function dumpBreakpointSidebarPane() | 119 function dumpBreakpointSidebarPane() |
121 { | 120 { |
122 var paneElement = WebInspector.panels.scripts.sidebarPanes.jsBreakpoints
.listElement | 121 var paneElement = WebInspector.panels.scripts.sidebarPanes.jsBreakpoints
.listElement |
123 InspectorTest.addResult(""); | 122 InspectorTest.addResult(""); |
124 InspectorTest.addResult("Dump breakpoint sidebar pane:"); | 123 InspectorTest.addResult("Dump breakpoint sidebar pane:"); |
125 InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElem
ent)); | 124 InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElem
ent)); |
126 } | 125 } |
| 126 |
| 127 function setBreakpointAndWaitUntilPaused(sourceFrame, lineNumber, pausedCall
back) |
| 128 { |
| 129 var expectedBreakpointId; |
| 130 InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoint.proto
type, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); |
| 131 InspectorTest.setBreakpoint(sourceFrame, lineNumber, "", true); |
| 132 |
| 133 function didSetBreakpointInDebugger(breakpointId) |
| 134 { |
| 135 expectedBreakpointId = breakpointId; |
| 136 InspectorTest.waitUntilPaused(didPause); |
| 137 } |
| 138 |
| 139 function didPause(callFrames, reason, breakpointIds) |
| 140 { |
| 141 InspectorTest.assertEquals(breakpointIds.length, 1); |
| 142 InspectorTest.assertEquals(breakpointIds[0], expectedBreakpointId); |
| 143 InspectorTest.assertEquals(reason, "other"); |
| 144 |
| 145 pausedCallback(callFrames); |
| 146 } |
| 147 } |
127 } | 148 } |
128 | 149 |
129 </script> | 150 </script> |
130 </head> | 151 </head> |
131 | 152 |
132 <body onload="runTest()"> | 153 <body onload="runTest()"> |
133 <p> | 154 <p> |
134 Tests setting breakpoints. | 155 Tests setting breakpoints. |
135 </p> | 156 </p> |
136 | 157 |
137 </body> | 158 </body> |
138 </html> | 159 </html> |
OLD | NEW |