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 if (quiet !== undefined) | 5 if (quiet !== undefined) |
6 InspectorTest._quiet = quiet; | 6 InspectorTest._quiet = quiet; |
7 WebInspector.showPanel("scripts"); | 7 WebInspector.showPanel("sources"); |
8 | 8 |
9 if (WebInspector.debuggerModel.debuggerEnabled()) | 9 if (WebInspector.debuggerModel.debuggerEnabled()) |
10 startTest(); | 10 startTest(); |
11 else { | 11 else { |
12 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable
d", startTest); | 12 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable
d", startTest); |
13 WebInspector.debuggerModel.enableDebugger(); | 13 WebInspector.debuggerModel.enableDebugger(); |
14 } | 14 } |
15 | 15 |
16 function startTest() | 16 function startTest() |
17 { | 17 { |
18 InspectorTest.addResult("Debugger was enabled."); | 18 InspectorTest.addResult("Debugger was enabled."); |
19 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", In
spectorTest._pausedScript, true); | 19 InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", In
spectorTest._pausedScript, true); |
20 InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", I
nspectorTest._resumedScript, true); | 20 InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", I
nspectorTest._resumedScript, true); |
21 InspectorTest.safeWrap(callback)(); | 21 InspectorTest.safeWrap(callback)(); |
22 } | 22 } |
23 }; | 23 }; |
24 | 24 |
25 InspectorTest.finishDebuggerTest = function(callback) | 25 InspectorTest.finishDebuggerTest = function(callback) |
26 { | 26 { |
27 var scriptsPanel = WebInspector.panels.scripts; | 27 var sourcesPanel = WebInspector.panels.sources; |
28 | 28 |
29 WebInspector.debuggerModel.setBreakpointsActive(true); | 29 WebInspector.debuggerModel.setBreakpointsActive(true); |
30 InspectorTest.resumeExecution(disableDebugger); | 30 InspectorTest.resumeExecution(disableDebugger); |
31 | 31 |
32 function disableDebugger() | 32 function disableDebugger() |
33 { | 33 { |
34 if (!WebInspector.debuggerModel.debuggerEnabled()) | 34 if (!WebInspector.debuggerModel.debuggerEnabled()) |
35 completeTest(); | 35 completeTest(); |
36 else { | 36 else { |
37 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDi
sabled", debuggerDisabled); | 37 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDi
sabled", debuggerDisabled); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 callback = InspectorTest.safeWrap(callback); | 98 callback = InspectorTest.safeWrap(callback); |
99 | 99 |
100 if (!InspectorTest._pausedScriptArguments) | 100 if (!InspectorTest._pausedScriptArguments) |
101 callback(); | 101 callback(); |
102 else | 102 else |
103 InspectorTest._waitUntilResumedCallback = callback; | 103 InspectorTest._waitUntilResumedCallback = callback; |
104 }; | 104 }; |
105 | 105 |
106 InspectorTest.resumeExecution = function(callback) | 106 InspectorTest.resumeExecution = function(callback) |
107 { | 107 { |
108 if (WebInspector.panels.scripts.paused) | 108 if (WebInspector.panels.sources.paused) |
109 WebInspector.panels.scripts._togglePause(); | 109 WebInspector.panels.sources._togglePause(); |
110 InspectorTest.waitUntilResumed(callback); | 110 InspectorTest.waitUntilResumed(callback); |
111 }; | 111 }; |
112 | 112 |
113 InspectorTest.captureStackTrace = function(callFrames, dropLineNumbers) | 113 InspectorTest.captureStackTrace = function(callFrames, dropLineNumbers) |
114 { | 114 { |
115 InspectorTest.addResult("Call stack:"); | 115 InspectorTest.addResult("Call stack:"); |
116 for (var i = 0; i < callFrames.length; i++) { | 116 for (var i = 0; i < callFrames.length; i++) { |
117 var frame = callFrames[i]; | 117 var frame = callFrames[i]; |
118 var script = WebInspector.debuggerModel.scriptForId(frame.location.scrip
tId); | 118 var script = WebInspector.debuggerModel.scriptForId(frame.location.scrip
tId); |
119 var url; | 119 var url; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 delete InspectorTest._pausedScriptArguments; | 158 delete InspectorTest._pausedScriptArguments; |
159 if (InspectorTest._waitUntilResumedCallback) { | 159 if (InspectorTest._waitUntilResumedCallback) { |
160 var callback = InspectorTest._waitUntilResumedCallback; | 160 var callback = InspectorTest._waitUntilResumedCallback; |
161 delete InspectorTest._waitUntilResumedCallback; | 161 delete InspectorTest._waitUntilResumedCallback; |
162 callback(); | 162 callback(); |
163 } | 163 } |
164 }; | 164 }; |
165 | 165 |
166 InspectorTest.showUISourceCode = function(uiSourceCode, callback) | 166 InspectorTest.showUISourceCode = function(uiSourceCode, callback) |
167 { | 167 { |
168 var panel = WebInspector.showPanel("scripts"); | 168 var panel = WebInspector.showPanel("sources"); |
169 panel.showUISourceCode(uiSourceCode); | 169 panel.showUISourceCode(uiSourceCode); |
170 var sourceFrame = panel.visibleView; | 170 var sourceFrame = panel.visibleView; |
171 if (sourceFrame.loaded) | 171 if (sourceFrame.loaded) |
172 callback(sourceFrame); | 172 callback(sourceFrame); |
173 else | 173 else |
174 InspectorTest.addSniffer(sourceFrame, "onTextEditorContentLoaded", callb
ack.bind(null, sourceFrame)); | 174 InspectorTest.addSniffer(sourceFrame, "onTextEditorContentLoaded", callb
ack.bind(null, sourceFrame)); |
175 }; | 175 }; |
176 | 176 |
177 InspectorTest.showScriptSource = function(scriptName, callback) | 177 InspectorTest.showScriptSource = function(scriptName, callback) |
178 { | 178 { |
179 var panel = WebInspector.showPanel("scripts"); | 179 var panel = WebInspector.showPanel("sources"); |
180 var uiSourceCodes = panel._workspace.uiSourceCodes(); | 180 var uiSourceCodes = panel._workspace.uiSourceCodes(); |
181 for (var i = 0; i < uiSourceCodes.length; ++i) { | 181 for (var i = 0; i < uiSourceCodes.length; ++i) { |
182 if (uiSourceCodes[i].name() === scriptName) { | 182 if (uiSourceCodes[i].name() === scriptName) { |
183 InspectorTest.showUISourceCode(uiSourceCodes[i], callback); | 183 InspectorTest.showUISourceCode(uiSourceCodes[i], callback); |
184 return; | 184 return; |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 InspectorTest.addSniffer(WebInspector.ScriptsPanel.prototype, "_addUISourceC
ode", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback)); | 188 InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "_addUISourceC
ode", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback)); |
189 }; | 189 }; |
190 | 190 |
191 InspectorTest.dumpScriptsNavigator = function(navigator, prefix) | 191 InspectorTest.dumpScriptsNavigator = function(navigator, prefix) |
192 { | 192 { |
193 prefix = prefix || ""; | 193 prefix = prefix || ""; |
194 InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Scripts' tab:"); | 194 InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Scripts' tab:"); |
195 dumpNavigatorTreeOutline(prefix, navigator._scriptsView._scriptsTree); | 195 dumpNavigatorTreeOutline(prefix, navigator._sourcesView._scriptsTree); |
196 InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Content scripts'
tab:"); | 196 InspectorTest.addResult(prefix + "Dumping ScriptsNavigator 'Content scripts'
tab:"); |
197 dumpNavigatorTreeOutline(prefix, navigator._contentScriptsView._scriptsTree)
; | 197 dumpNavigatorTreeOutline(prefix, navigator._contentScriptsView._scriptsTree)
; |
198 | 198 |
199 function dumpNavigatorTreeElement(prefix, treeElement) | 199 function dumpNavigatorTreeElement(prefix, treeElement) |
200 { | 200 { |
201 InspectorTest.addResult(prefix + treeElement.titleText); | 201 InspectorTest.addResult(prefix + treeElement.titleText); |
202 for (var i = 0; i < treeElement.children.length; ++i) | 202 for (var i = 0; i < treeElement.children.length; ++i) |
203 dumpNavigatorTreeElement(prefix + " ", treeElement.children[i]); | 203 dumpNavigatorTreeElement(prefix + " ", treeElement.children[i]); |
204 } | 204 } |
205 | 205 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) | 309 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) |
310 { | 310 { |
311 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.originURL() : null) + "'
," + | 311 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.originURL() : null) + "'
," + |
312 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); | 312 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); |
313 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber, expected '" + lineNumber + "', but got '" + location.lineNumber + "'"); | 313 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber, expected '" + lineNumber + "', but got '" + location.lineNumber + "'"); |
314 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber, expected '" + columnNumber + "', but got '" + location.columnNumber
+ "'"); | 314 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber, expected '" + columnNumber + "', but got '" + location.columnNumber
+ "'"); |
315 }; | 315 }; |
316 | 316 |
317 }; | 317 }; |
OLD | NEW |