| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../../http/tests/inspector/live-edit-test.js"></script> | 5 <script src="../../../http/tests/inspector/live-edit-test.js"></script> |
| 6 <script src="resources/edit-me-breakpoints.js"></script> | 6 <script src="resources/edit-me-breakpoints.js"></script> |
| 7 <script> | 7 <script> |
| 8 function loadDynamicAnonymousScript() | 8 function loadDynamicAnonymousScript() |
| 9 { | 9 { |
| 10 function testFunction() | 10 function testFunction() |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 for (var i = 0; i < breakpoints.length; ++i) { | 49 for (var i = 0; i < breakpoints.length; ++i) { |
| 50 var breakpoint = breakpoints[i]; | 50 var breakpoint = breakpoints[i]; |
| 51 var uiSourceCode = breakpointManager._workspace.uiSourceCode(breakpo
int.projectId(), breakpoint.path()); | 51 var uiSourceCode = breakpointManager._workspace.uiSourceCode(breakpo
int.projectId(), breakpoint.path()); |
| 52 var lineNumber = breakpoint.lineNumber(); | 52 var lineNumber = breakpoint.lineNumber(); |
| 53 var url = uiSourceCode.url(); | 53 var url = uiSourceCode.url(); |
| 54 var project = uiSourceCode.project(); | 54 var project = uiSourceCode.project(); |
| 55 InspectorTest.addResult(" url: " + pathToFileName(url) + ", l
ineNumber: " + lineNumber + ", project type: " + project.type()); | 55 InspectorTest.addResult(" url: " + pathToFileName(url) + ", l
ineNumber: " + lineNumber + ", project type: " + project.type()); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 function addBreakpointSniffer(lineNumber, disabled) | 59 function breakpointDecorationUpdatedSniffer(lineNumber, disabled, removed) |
| 60 { | 60 { |
| 61 var prefix = this.main ? "" : "Original"; | 61 var prefix = this._textEditor.main ? "" : "Original"; |
| 62 InspectorTest.addResult(" " + prefix + "TextEditor.addBreakpoint(line
Number = " + lineNumber + ", disabled = " + disabled + ")"); | 62 if (!removed) { |
| 63 } | 63 InspectorTest.addResult(" " + prefix + "TextEditor.addBreakpoint(
lineNumber = " + lineNumber + ", disabled = " + disabled + ")"); |
| 64 | 64 } else { |
| 65 function removeBreakpointSniffer(lineNumber) | 65 InspectorTest.addResult(" " + prefix + "TextEditor.removeBreakpoi
nt(lineNumber = " + lineNumber + ")"); |
| 66 { | 66 } |
| 67 var prefix = this.main ? "" : "Original"; | |
| 68 InspectorTest.addResult(" " + prefix + "TextEditor.removeBreakpoint(l
ineNumber = " + lineNumber + ")"); | |
| 69 } | 67 } |
| 70 | 68 |
| 71 Bindings.breakpointManager._storage._breakpoints = {}; | 69 Bindings.breakpointManager._storage._breakpoints = {}; |
| 72 | 70 |
| 73 InspectorTest.runDebuggerTestSuite([ | 71 InspectorTest.runDebuggerTestSuite([ |
| 74 function testEditUndo(next) | 72 function testEditUndo(next) |
| 75 { | 73 { |
| 76 var javaScriptSourceFrame, uiSourceCode, script, originalJavaScriptS
ourceFrame, originalUISourceCode; | 74 var javaScriptSourceFrame, uiSourceCode, script, originalJavaScriptS
ourceFrame, originalUISourceCode; |
| 77 | 75 |
| 78 InspectorTest.showScriptSource("edit-me-breakpoints.js", didShowScri
ptSource); | 76 InspectorTest.showScriptSource("edit-me-breakpoints.js", didShowScri
ptSource); |
| 79 | 77 |
| 80 function didShowScriptSource(sourceFrame) | 78 function didShowScriptSource(sourceFrame) |
| 81 { | 79 { |
| 82 javaScriptSourceFrame = sourceFrame; | 80 javaScriptSourceFrame = sourceFrame; |
| 83 uiSourceCode = sourceFrame._uiSourceCode; | 81 uiSourceCode = sourceFrame._uiSourceCode; |
| 84 javaScriptSourceFrame._textEditor.main = true; | 82 javaScriptSourceFrame._textEditor.main = true; |
| 85 | 83 |
| 86 InspectorTest.addSniffer(javaScriptSourceFrame._textEditor.__pro
to__, "addBreakpoint", addBreakpointSniffer, true); | 84 InspectorTest.addSniffer(javaScriptSourceFrame.__proto__, "_brea
kpointDecorationsUpdatedForTest", breakpointDecorationUpdatedSniffer, true); |
| 87 InspectorTest.addSniffer(javaScriptSourceFrame._textEditor.__pro
to__, "removeBreakpoint", removeBreakpointSniffer, true); | |
| 88 | 85 |
| 89 InspectorTest.addResult("Setting breakpoint:"); | 86 InspectorTest.addResult("Setting breakpoint:"); |
| 90 InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakp
oint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); | 87 InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakp
oint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); |
| 91 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 88 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 92 } | 89 } |
| 93 | 90 |
| 94 function breakpointResolved(callback, breakpointId, locations) | 91 function breakpointResolved(callback, breakpointId, locations) |
| 95 { | 92 { |
| 96 var location = locations[0]; | 93 var location = locations[0]; |
| 97 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); | 94 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 ]); | 308 ]); |
| 312 }; | 309 }; |
| 313 | 310 |
| 314 </script> | 311 </script> |
| 315 </head> | 312 </head> |
| 316 <body onload="runTest()"> | 313 <body onload="runTest()"> |
| 317 <p>Tests breakpoints are correctly dimmed and restored in JavaScriptSourceFrame
during live edit.</p> | 314 <p>Tests breakpoints are correctly dimmed and restored in JavaScriptSourceFrame
during live edit.</p> |
| 318 <a href="https://bugs.webkit.org/show_bug.cgi?id=99598">Bug 99598</a> | 315 <a href="https://bugs.webkit.org/show_bug.cgi?id=99598">Bug 99598</a> |
| 319 </body> | 316 </body> |
| 320 </html> | 317 </html> |
| OLD | NEW |