OLD | NEW |
1 var initialize_DebuggerTest = function() { | 1 var initialize_DebuggerTest = function() { |
2 | 2 |
3 InspectorTest.startDebuggerTest = function(callback, quiet) | 3 InspectorTest.startDebuggerTest = function(callback, quiet) |
4 { | 4 { |
5 console.assert(WebInspector.debuggerModel.debuggerEnabled(), "Debugger has t
o be enabled"); | 5 console.assert(WebInspector.debuggerModel.debuggerEnabled(), "Debugger has t
o be enabled"); |
6 if (quiet !== undefined) | 6 if (quiet !== undefined) |
7 InspectorTest._quiet = quiet; | 7 InspectorTest._quiet = quiet; |
8 WebInspector.inspectorView.showPanel("sources"); | 8 WebInspector.inspectorView.showPanel("sources"); |
9 | 9 |
10 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", Inspec
torTest._pausedScript, true); | 10 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", Inspec
torTest._pausedScript, true); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 InspectorTest.addResult(caption); | 152 InspectorTest.addResult(caption); |
153 InspectorTest.runAfterPendingDispatches(step2); | 153 InspectorTest.runAfterPendingDispatches(step2); |
154 } | 154 } |
155 | 155 |
156 function step2() | 156 function step2() |
157 { | 157 { |
158 InspectorTest.resumeExecution(InspectorTest.safeWrap(callback)); | 158 InspectorTest.resumeExecution(InspectorTest.safeWrap(callback)); |
159 } | 159 } |
160 }; | 160 }; |
161 | 161 |
| 162 InspectorTest.waitUntilPausedAndPerformSteppingActions = function(actions, callb
ack) |
| 163 { |
| 164 callback = InspectorTest.safeWrap(callback); |
| 165 InspectorTest.waitUntilPaused(didPause); |
| 166 |
| 167 function didPause(callFrames, reason, breakpointIds, asyncStackTrace) |
| 168 { |
| 169 var action = actions.shift(); |
| 170 if (action === "Print") { |
| 171 InspectorTest.captureStackTrace(callFrames, asyncStackTrace); |
| 172 InspectorTest.addResult(""); |
| 173 while (action === "Print") |
| 174 action = actions.shift(); |
| 175 } |
| 176 |
| 177 if (!action) { |
| 178 callback() |
| 179 return; |
| 180 } |
| 181 |
| 182 InspectorTest.addResult("Executing " + action + "..."); |
| 183 |
| 184 switch (action) { |
| 185 case "StepInto": |
| 186 WebInspector.panels.sources._stepIntoButton.element.click(); |
| 187 break; |
| 188 case "StepOver": |
| 189 WebInspector.panels.sources._stepOverButton.element.click(); |
| 190 break; |
| 191 case "StepOut": |
| 192 WebInspector.panels.sources._stepOutButton.element.click(); |
| 193 break; |
| 194 case "Resume": |
| 195 WebInspector.panels.sources.togglePause(); |
| 196 break; |
| 197 default: |
| 198 InspectorTest.addResult("FAIL: Unknown action: " + action); |
| 199 callback() |
| 200 return; |
| 201 } |
| 202 |
| 203 InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(Inspec
torTest, didPause)); |
| 204 } |
| 205 }; |
| 206 |
162 InspectorTest.captureStackTrace = function(callFrames, asyncStackTrace, options) | 207 InspectorTest.captureStackTrace = function(callFrames, asyncStackTrace, options) |
163 { | 208 { |
164 InspectorTest.addResult(InspectorTest.captureStackTraceIntoString(callFrames
, asyncStackTrace, options)); | 209 InspectorTest.addResult(InspectorTest.captureStackTraceIntoString(callFrames
, asyncStackTrace, options)); |
165 }; | 210 }; |
166 | 211 |
167 InspectorTest.captureStackTraceIntoString = function(callFrames, asyncStackTrace
, options) | 212 InspectorTest.captureStackTraceIntoString = function(callFrames, asyncStackTrace
, options) |
168 { | 213 { |
169 var results = []; | 214 var results = []; |
170 options = options || {}; | 215 options = options || {}; |
171 | 216 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 InspectorTest.scriptFormatter = function() | 453 InspectorTest.scriptFormatter = function() |
409 { | 454 { |
410 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source
sView.EditorAction); | 455 var editorActions = WebInspector.moduleManager.instances(WebInspector.Source
sView.EditorAction); |
411 for (var i = 0; i < editorActions.length; ++i) { | 456 for (var i = 0; i < editorActions.length; ++i) { |
412 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction
) | 457 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction
) |
413 return editorActions[i]; | 458 return editorActions[i]; |
414 } | 459 } |
415 }; | 460 }; |
416 | 461 |
417 }; | 462 }; |
OLD | NEW |