Changeset 85315 in webkit
- Timestamp:
- Apr 29, 2011 4:35:58 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85306 r85315 1 2011-04-28 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: breakpoints set in original and formatted scripts are messed up after navigation. 6 https://bugs.webkit.org/show_bug.cgi?id=59476 7 8 * http/tests/inspector/inspector-test.js: 9 (initialize_InspectorTest.InspectorTest.navigate): 10 (initialize_InspectorTest.InspectorTest.reloadPage): 11 (initialize_InspectorTest.InspectorTest.pageLoaded): 12 (initialize_InspectorTest.InspectorTest.runWhenPageLoads): 13 (): 14 * inspector/debugger/script-formatter-expected.txt: 15 * inspector/debugger/script-formatter.html: 16 1 17 2011-04-28 Adam Roben <aroben@apple.com> 2 18 -
trunk/LayoutTests/http/tests/inspector/inspector-test.js
r84772 r85315 151 151 } 152 152 153 InspectorTest.navigate = function(url, callback) 154 { 155 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); 156 157 if (WebInspector.panels.network) 158 WebInspector.panels.network._reset(); 159 InspectorTest.evaluateInConsole("window.location = '" + url + "'"); 160 } 161 153 162 InspectorTest.reloadPage = function(callback) 154 163 { 155 InspectorTest._ reloadPageCallback = InspectorTest.safeWrap(callback);164 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); 156 165 157 166 if (WebInspector.panels.network) … … 160 169 } 161 170 162 InspectorTest.page Reloaded = function()171 InspectorTest.pageLoaded = function() 163 172 { 164 173 resultsSynchronized = false; 165 174 InspectorTest.addResult("Page reloaded."); 166 if (InspectorTest._ reloadPageCallback) {167 var callback = InspectorTest._ reloadPageCallback;168 delete InspectorTest._ reloadPageCallback;175 if (InspectorTest._pageLoadedCallback) { 176 var callback = InspectorTest._pageLoadedCallback; 177 delete InspectorTest._pageLoadedCallback; 169 178 callback(); 170 179 } … … 173 182 InspectorTest.runWhenPageLoads = function(callback) 174 183 { 175 var oldCallback = InspectorTest._ reloadPageCallback;184 var oldCallback = InspectorTest._pageLoadedCallback; 176 185 function chainedCallback() 177 186 { … … 180 189 callback(); 181 190 } 182 InspectorTest._ reloadPageCallback = InspectorTest.safeWrap(chainedCallback);191 InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(chainedCallback); 183 192 } 184 193 … … 342 351 { 343 352 if (window.InspectorTest) { 344 InspectorTest.page Reloaded();353 InspectorTest.pageLoaded(); 345 354 return; 346 355 } -
trunk/LayoutTests/inspector/debugger/script-formatter-expected.txt
r84625 r85315 15 15 } 16 16 </script></body></html> 17 18 Running: testBreakpointsInOriginalAndFormattedSource 19 Script execution paused. 20 Call stack: 21 0) f1 (script-formatter.html:12) 22 1) (script-formatter.html:1) 23 Script execution resumed. 24 Page reloaded. 25 Navigated to test-navigation.html 26 Page reloaded. 27 Navigated back to test page. 28 Script execution paused. 29 Call stack: 30 0) f2 (script-formatter.html:17) 31 1) (script-formatter.html:1) 32 Script execution resumed. 17 33 Debugger was disabled. 18 34 -
trunk/LayoutTests/inspector/debugger/script-formatter.html
r84625 r85315 7 7 <script> 8 8 9 function f1() 10 { 11 var a=0;var b=1;var c=3;var d=4;var e=5; 12 var f=0; 13 return 0; 14 } 15 16 function f2() 17 { 18 var x = 0; 19 return 0; 20 } 21 9 22 var test = function() 10 23 { 24 var panel = WebInspector.panels.scripts; 11 25 var worker = new Worker("ScriptFormatterWorker.js"); 12 26 … … 85 99 var content = "<html><body><script>function f(){}<" + "/script><script>function g(){}<" + "/script></body></html>"; 86 100 worker.postMessage({ mimeType: "text/html", content: content }); 101 }, 102 103 function testBreakpointsInOriginalAndFormattedSource(next) 104 { 105 var root; 106 InspectorTest.showScriptSource("script-formatter.html", didShowScriptSource); 107 108 function didShowScriptSource(sourceFrame) 109 { 110 root = sourceFrame._url.substr(0, sourceFrame._url.lastIndexOf("/") + 1); 111 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); 112 InspectorTest.waitUntilPaused(pausedInF1); 113 InspectorTest.evaluateInPageWithTimeout("f1()"); 114 } 115 116 function pausedInF1(callFrames) 117 { 118 InspectorTest.captureStackTrace(callFrames); 119 InspectorTest.resumeExecution(resumed); 120 } 121 122 function resumed() 123 { 124 InspectorTest.navigate(root + "resources/test-navigation.html", didNavigateAnotherPage); 125 } 126 127 function didNavigateAnotherPage() 128 { 129 InspectorTest.addResult("Navigated to test-navigation.html"); 130 panel._toggleFormatSourceFiles(); 131 InspectorTest.showScriptSource("test-navigation.html", didShowAnotherPage); 132 } 133 134 function didShowAnotherPage(sourceFrame) 135 { 136 InspectorTest.navigate(root + "script-formatter.html", didNavigateBack); 137 } 138 139 function didNavigateBack() 140 { 141 InspectorTest.addResult("Navigated back to test page."); 142 InspectorTest.showScriptSource("script-formatter.html", didShowFormattedScriptSource); 143 } 144 145 function didShowFormattedScriptSource(sourceFrame) 146 { 147 // There should be no breakpoint in f1 since script is pretty-printed now. 148 InspectorTest.evaluateInPageWithTimeout("f1()"); 149 150 InspectorTest.setBreakpoint(panel.visibleView, 24, "", true); 151 InspectorTest.waitUntilPaused(pausedInF2); 152 InspectorTest.evaluateInPageWithTimeout("f2()"); 153 } 154 155 function pausedInF2(callFrames) 156 { 157 InspectorTest.captureStackTrace(callFrames); 158 next(); 159 } 87 160 } 88 161 ]); -
trunk/Source/WebCore/ChangeLog
r85312 r85315 1 2011-04-28 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: breakpoints set in original and formatted scripts are messed up after navigation. 6 https://bugs.webkit.org/show_bug.cgi?id=59476 7 8 * inspector/front-end/DebuggerPresentationModel.js: 9 (WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles): 10 (WebInspector.DebuggerPresentationModel.prototype._removeBreakpointFromDebugger): 11 (WebInspector.PresentationBreakpoint.prototype.serialize): 12 * inspector/front-end/ScriptsPanel.js: 13 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect.optionCompare): 14 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect): 15 (WebInspector.ScriptsPanel.prototype.reset): 16 1 17 2011-04-29 Pavel Feldman <pfeldman@google.com> 2 18 -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r85204 r85315 211 211 } 212 212 213 for (var id in this._breakpointsWithoutSourceFile) { 214 var breakpoints = this._breakpointsWithoutSourceFile[id]; 215 for (var i = 0; i < breakpoints.length; ++i) 216 this._removeBreakpointFromDebugger(breakpoints[i]); 217 } 218 213 219 var messages = this._messages; 214 220 this._reset(); … … 331 337 _removeBreakpointFromDebugger: function(breakpoint, callback) 332 338 { 333 if (!("debuggerId" in breakpoint)) { 334 if (callback) 335 callback(); 336 return; 337 } 338 339 function didRemoveBreakpoint() 340 { 339 if ("debuggerId" in breakpoint) { 340 WebInspector.debuggerModel.removeBreakpoint(breakpoint.debuggerId); 341 341 this._unbindDebuggerId(breakpoint); 342 if (callback)343 callback(); 344 }345 WebInspector.debuggerModel.removeBreakpoint(breakpoint.debuggerId, didRemoveBreakpoint.bind(this));342 } 343 344 if (callback) 345 callback(); 346 346 }, 347 347 … … 632 632 serializedBreakpoint.condition = this.condition; 633 633 serializedBreakpoint.enabled = this.enabled; 634 serializedBreakpoint.debuggerId = this.debuggerId; 634 if ("debuggerId" in this) 635 serializedBreakpoint.debuggerId = this.debuggerId; 635 636 return serializedBreakpoint; 636 637 } -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r85266 r85315 296 296 297 297 if (a.isContentScript && !b.isContentScript) 298 return 1; 298 return 1; 299 299 if (!a.isContentScript && b.isContentScript) 300 return -1; 300 return -1; 301 301 302 302 if (a.text === b.text) … … 480 480 this._updateBackAndForwardButtons(); 481 481 482 for (var id in this._sourceFileIdToSourceFrame) { 483 var sourceFrame = this._sourceFileIdToSourceFrame[id]; 484 sourceFrame.removeEventListener(WebInspector.SourceFrame.Events.Loaded, this._sourceFrameLoaded, this); 485 } 486 482 487 this._sourceFileIdToSourceFrame = {}; 483 488 this._sourceFileIdToFilesSelectOption = {};
Note: See TracChangeset
for help on using the changeset viewer.