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("scripts"); |
8 | 8 |
9 if (WebInspector.debuggerModel.debuggerEnabled()) | 9 if (WebInspector.debuggerModel.debuggerEnabled()) |
10 startTest(); | 10 startTest(); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 return scripts; | 279 return scripts; |
280 }; | 280 }; |
281 | 281 |
282 InspectorTest.createScriptMock = function(url, startLine, startColumn, isContent
Script, source) | 282 InspectorTest.createScriptMock = function(url, startLine, startColumn, isContent
Script, source) |
283 { | 283 { |
284 var scriptId = ++InspectorTest._lastScriptId; | 284 var scriptId = ++InspectorTest._lastScriptId; |
285 var lineCount = source.lineEndings().length; | 285 var lineCount = source.lineEndings().length; |
286 var endLine = startLine + lineCount - 1; | 286 var endLine = startLine + lineCount - 1; |
287 var endColumn = lineCount === 1 ? startColumn + source.length : source.lengt
h - source.lineEndings()[lineCount - 2]; | 287 var endColumn = lineCount === 1 ? startColumn + source.length : source.lengt
h - source.lineEndings()[lineCount - 2]; |
288 var hasSourceURL = !!source.match(/\/\/@\ssourceURL=\s*(\S*?)\s*$/m); | 288 var hasSourceURL = !!source.match(/\/\/#\ssourceURL=\s*(\S*?)\s*$/m) || !!so
urce.match(/\/\/@\ssourceURL=\s*(\S*?)\s*$/m); |
289 var script = new WebInspector.Script(scriptId, url, startLine, startColumn,
endLine, endColumn, isContentScript, null, hasSourceURL); | 289 var script = new WebInspector.Script(scriptId, url, startLine, startColumn,
endLine, endColumn, isContentScript, null, hasSourceURL); |
290 script.requestContent = function(callback) { callback(source, false, "text/j
avascript"); }; | 290 script.requestContent = function(callback) { callback(source, false, "text/j
avascript"); }; |
291 WebInspector.debuggerModel._registerScript(script); | 291 WebInspector.debuggerModel._registerScript(script); |
292 return script; | 292 return script; |
293 } | 293 } |
294 | 294 |
295 InspectorTest._lastScriptId = 0; | 295 InspectorTest._lastScriptId = 0; |
296 | 296 |
297 InspectorTest.checkRawLocation = function(script, lineNumber, columnNumber, loca
tion) | 297 InspectorTest.checkRawLocation = function(script, lineNumber, columnNumber, loca
tion) |
298 { | 298 { |
299 InspectorTest.assertEquals(script.scriptId, location.scriptId, "Incorrect sc
riptId"); | 299 InspectorTest.assertEquals(script.scriptId, location.scriptId, "Incorrect sc
riptId"); |
300 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber"); | 300 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber"); |
301 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber"); | 301 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber"); |
302 }; | 302 }; |
303 | 303 |
304 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) | 304 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) |
305 { | 305 { |
306 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.originURL() : null) + "'
," + | 306 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.originURL() : null) + "'
," + |
307 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); | 307 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); |
308 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber, expected '" + lineNumber + "', but got '" + location.lineNumber + "'"); | 308 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber, expected '" + lineNumber + "', but got '" + location.lineNumber + "'"); |
309 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber, expected '" + columnNumber + "', but got '" + location.columnNumber
+ "'"); | 309 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber, expected '" + columnNumber + "', but got '" + location.columnNumber
+ "'"); |
310 }; | 310 }; |
311 | 311 |
312 }; | 312 }; |
OLD | NEW |