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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 var nextTest = testSuiteTests.shift(); | 65 var nextTest = testSuiteTests.shift(); |
66 InspectorTest.addResult(""); | 66 InspectorTest.addResult(""); |
67 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); | 67 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); |
68 InspectorTest.safeWrap(nextTest)(runner, runner); | 68 InspectorTest.safeWrap(nextTest)(runner, runner); |
69 } | 69 } |
70 | 70 |
71 InspectorTest.startDebuggerTest(runner); | 71 InspectorTest.startDebuggerTest(runner); |
72 } | 72 } |
73 | 73 |
| 74 InspectorTest.runTestFunction = function() |
| 75 { |
| 76 InspectorTest.evaluateInConsole("setTimeout(testFunction, 0)"); |
| 77 InspectorTest.addResult("Set timer for test function."); |
| 78 } |
| 79 |
74 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) | 80 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) |
75 { | 81 { |
76 InspectorTest.evaluateInConsole("setTimeout(testFunction, 0)"); | 82 InspectorTest.runTestFunction(); |
77 InspectorTest.addResult("Set timer for test function."); | |
78 InspectorTest.waitUntilPaused(callback); | 83 InspectorTest.waitUntilPaused(callback); |
79 }; | 84 }; |
80 | 85 |
81 InspectorTest.waitUntilPaused = function(callback) | 86 InspectorTest.waitUntilPaused = function(callback) |
82 { | 87 { |
83 callback = InspectorTest.safeWrap(callback); | 88 callback = InspectorTest.safeWrap(callback); |
84 | 89 |
85 if (InspectorTest._callFrames) | 90 if (InspectorTest._pausedScriptArguments) |
86 callback(InspectorTest._callFrames); | 91 callback.apply(callback, InspectorTest._pausedScriptArguments); |
87 else | 92 else |
88 InspectorTest._waitUntilPausedCallback = callback; | 93 InspectorTest._waitUntilPausedCallback = callback; |
89 }; | 94 }; |
90 | 95 |
91 InspectorTest.waitUntilResumed = function(callback) | 96 InspectorTest.waitUntilResumed = function(callback) |
92 { | 97 { |
93 callback = InspectorTest.safeWrap(callback); | 98 callback = InspectorTest.safeWrap(callback); |
94 | 99 |
95 if (!InspectorTest._callFrames) | 100 if (!InspectorTest._pausedScriptArguments) |
96 callback(); | 101 callback(); |
97 else | 102 else |
98 InspectorTest._waitUntilResumedCallback = callback; | 103 InspectorTest._waitUntilResumedCallback = callback; |
99 }; | 104 }; |
100 | 105 |
101 InspectorTest.resumeExecution = function(callback) | 106 InspectorTest.resumeExecution = function(callback) |
102 { | 107 { |
103 if (WebInspector.panels.scripts.paused) | 108 if (WebInspector.panels.scripts.paused) |
104 WebInspector.panels.scripts._togglePause(); | 109 WebInspector.panels.scripts._togglePause(); |
105 InspectorTest.waitUntilResumed(callback); | 110 InspectorTest.waitUntilResumed(callback); |
(...skipping 21 matching lines...) Expand all Loading... |
127 | 132 |
128 InspectorTest.dumpSourceFrameContents = function(sourceFrame) | 133 InspectorTest.dumpSourceFrameContents = function(sourceFrame) |
129 { | 134 { |
130 InspectorTest.addResult("==Source frame contents start=="); | 135 InspectorTest.addResult("==Source frame contents start=="); |
131 var textEditor = sourceFrame._textEditor; | 136 var textEditor = sourceFrame._textEditor; |
132 for (var i = 0; i < textEditor.linesCount; ++i) | 137 for (var i = 0; i < textEditor.linesCount; ++i) |
133 InspectorTest.addResult(textEditor.line(i)); | 138 InspectorTest.addResult(textEditor.line(i)); |
134 InspectorTest.addResult("==Source frame contents end=="); | 139 InspectorTest.addResult("==Source frame contents end=="); |
135 }; | 140 }; |
136 | 141 |
137 InspectorTest._pausedScript = function(callFrames, reason, auxData) | 142 InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointId
s) |
138 { | 143 { |
139 if (!InspectorTest._quiet) | 144 if (!InspectorTest._quiet) |
140 InspectorTest.addResult("Script execution paused."); | 145 InspectorTest.addResult("Script execution paused."); |
141 InspectorTest._callFrames = callFrames; | 146 InspectorTest._pausedScriptArguments = [callFrames, reason, breakpointIds]; |
142 if (InspectorTest._waitUntilPausedCallback) { | 147 if (InspectorTest._waitUntilPausedCallback) { |
143 var callback = InspectorTest._waitUntilPausedCallback; | 148 var callback = InspectorTest._waitUntilPausedCallback; |
144 delete InspectorTest._waitUntilPausedCallback; | 149 delete InspectorTest._waitUntilPausedCallback; |
145 callback(InspectorTest._callFrames); | 150 callback.apply(callback, InspectorTest._pausedScriptArguments); |
146 } | 151 } |
147 } | 152 } |
148 | 153 |
149 InspectorTest._resumedScript = function() | 154 InspectorTest._resumedScript = function() |
150 { | 155 { |
151 if (!InspectorTest._quiet) | 156 if (!InspectorTest._quiet) |
152 InspectorTest.addResult("Script execution resumed."); | 157 InspectorTest.addResult("Script execution resumed."); |
153 delete InspectorTest._callFrames; | 158 delete InspectorTest._pausedScriptArguments; |
154 if (InspectorTest._waitUntilResumedCallback) { | 159 if (InspectorTest._waitUntilResumedCallback) { |
155 var callback = InspectorTest._waitUntilResumedCallback; | 160 var callback = InspectorTest._waitUntilResumedCallback; |
156 delete InspectorTest._waitUntilResumedCallback; | 161 delete InspectorTest._waitUntilResumedCallback; |
157 callback(); | 162 callback(); |
158 } | 163 } |
159 }; | 164 }; |
160 | 165 |
161 InspectorTest.showUISourceCode = function(uiSourceCode, callback) | 166 InspectorTest.showUISourceCode = function(uiSourceCode, callback) |
162 { | 167 { |
163 var panel = WebInspector.showPanel("scripts"); | 168 var panel = WebInspector.showPanel("scripts"); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 308 |
304 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) | 309 InspectorTest.checkUILocation = function(uiSourceCode, lineNumber, columnNumber,
location) |
305 { | 310 { |
306 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) + "'
," + |
307 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); | 312 " but got '"
+ (location.uiSourceCode ? location.uiSourceCode.originURL() : null) + "'"); |
308 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 + "'"); |
309 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
+ "'"); |
310 }; | 315 }; |
311 | 316 |
312 }; | 317 }; |
OLD | NEW |