| OLD | NEW |
| 1 function scheduleTestFunction() | 1 function scheduleTestFunction() |
| 2 { | 2 { |
| 3 setTimeout(testFunction, 0); | 3 setTimeout(testFunction, 0); |
| 4 } | 4 } |
| 5 | 5 |
| 6 var initialize_DebuggerTest = function() { | 6 var initialize_DebuggerTest = function() { |
| 7 | 7 |
| 8 InspectorTest.preloadPanel("sources"); | 8 InspectorTest.preloadPanel("sources"); |
| 9 | 9 |
| 10 InspectorTest.startDebuggerTest = function(callback, quiet) | 10 InspectorTest.startDebuggerTest = function(callback, quiet) |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 { | 571 { |
| 572 InspectorTest._quiet = quiet; | 572 InspectorTest._quiet = quiet; |
| 573 }; | 573 }; |
| 574 | 574 |
| 575 InspectorTest.queryScripts = function(filter) | 575 InspectorTest.queryScripts = function(filter) |
| 576 { | 576 { |
| 577 var scripts = InspectorTest.debuggerModel.scripts(); | 577 var scripts = InspectorTest.debuggerModel.scripts(); |
| 578 return filter ? scripts.filter(filter) : scripts; | 578 return filter ? scripts.filter(filter) : scripts; |
| 579 }; | 579 }; |
| 580 | 580 |
| 581 InspectorTest.createScriptMock = function(url, startLine, startColumn, isContent
Script, source, target, preRegisterCallback) | |
| 582 { | |
| 583 target = target || SDK.targetManager.mainTarget(); | |
| 584 var debuggerModel = target.model(SDK.DebuggerModel); | |
| 585 var scriptId = ++InspectorTest._lastScriptId + ""; | |
| 586 var lineCount = source.computeLineEndings().length; | |
| 587 var endLine = startLine + lineCount - 1; | |
| 588 var endColumn = lineCount === 1 ? startColumn + source.length : source.lengt
h - source.computeLineEndings()[lineCount - 2]; | |
| 589 var hasSourceURL = !!source.match(/\/\/#\ssourceURL=\s*(\S*?)\s*$/m) || !!so
urce.match(/\/\/@\ssourceURL=\s*(\S*?)\s*$/m); | |
| 590 var script = new SDK.Script(debuggerModel, scriptId, url, startLine, startCo
lumn, endLine, endColumn, 0, "", isContentScript, false, undefined, hasSourceURL
, source.length); | |
| 591 script.requestContent = function() | |
| 592 { | |
| 593 var trimmedSource = SDK.Script._trimSourceURLComment(source); | |
| 594 return Promise.resolve(trimmedSource); | |
| 595 }; | |
| 596 if (preRegisterCallback) | |
| 597 preRegisterCallback(script); | |
| 598 debuggerModel._registerScript(script); | |
| 599 return script; | |
| 600 }; | |
| 601 | |
| 602 InspectorTest._lastScriptId = 0; | |
| 603 | |
| 604 InspectorTest.checkRawLocation = function(script, lineNumber, columnNumber, loca
tion) | 581 InspectorTest.checkRawLocation = function(script, lineNumber, columnNumber, loca
tion) |
| 605 { | 582 { |
| 606 InspectorTest.assertEquals(script.scriptId, location.scriptId, "Incorrect sc
riptId"); | 583 InspectorTest.assertEquals(script.scriptId, location.scriptId, "Incorrect sc
riptId"); |
| 607 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber"); | 584 InspectorTest.assertEquals(lineNumber, location.lineNumber, "Incorrect lineN
umber"); |
| 608 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber"); | 585 InspectorTest.assertEquals(columnNumber, location.columnNumber, "Incorrect c
olumnNumber"); |
| 609 }; | 586 }; |
| 610 | 587 |
| 611 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) | 588 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) |
| 612 { | 589 { |
| 613 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.url() : null) + "'," + | 590 InspectorTest.assertEquals(uiSourceCode, location.uiSourceCode, "Incorrect u
iSourceCode, expected '" + (uiSourceCode ? uiSourceCode.url() : null) + "'," + |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 if (targetName) | 715 if (targetName) |
| 739 auxData.targetName = targetName; | 716 auxData.targetName = targetName; |
| 740 var breakpoint = SDK.domDebuggerManager.resolveEventListenerBreakpoint(auxDa
ta); | 717 var breakpoint = SDK.domDebuggerManager.resolveEventListenerBreakpoint(auxDa
ta); |
| 741 if (breakpoint.enabled() !== enabled) { | 718 if (breakpoint.enabled() !== enabled) { |
| 742 pane._breakpoints.get(breakpoint).checkbox.checked = enabled; | 719 pane._breakpoints.get(breakpoint).checkbox.checked = enabled; |
| 743 pane._breakpointCheckboxClicked(breakpoint); | 720 pane._breakpointCheckboxClicked(breakpoint); |
| 744 } | 721 } |
| 745 } | 722 } |
| 746 | 723 |
| 747 }; | 724 }; |
| OLD | NEW |