| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 InspectorTest.addSniffer(javaScriptSourceFrame._textEditor.__pro
to__, "removeBreakpoint", removeBreakpointSniffer, true); | 87 InspectorTest.addSniffer(javaScriptSourceFrame._textEditor.__pro
to__, "removeBreakpoint", removeBreakpointSniffer, true); |
| 88 | 88 |
| 89 InspectorTest.addResult("Setting breakpoint:"); | 89 InspectorTest.addResult("Setting breakpoint:"); |
| 90 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); | 90 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); |
| 91 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 91 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 92 } | 92 } |
| 93 | 93 |
| 94 function breakpointResolved(callback, breakpointId, locations) | 94 function breakpointResolved(callback, breakpointId, locations) |
| 95 { | 95 { |
| 96 var location = locations[0]; | 96 var location = locations[0]; |
| 97 script = WebInspector.debuggerModel.scriptForId(location.scriptI
d); | 97 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); |
| 98 | 98 |
| 99 dumpBreakpointStorageAndLocations(); | 99 dumpBreakpointStorageAndLocations(); |
| 100 InspectorTest.addResult("Editing source:"); | 100 InspectorTest.addResult("Editing source:"); |
| 101 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//")
; | 101 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//")
; |
| 102 | 102 |
| 103 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; | 103 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; |
| 104 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); | 104 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); |
| 105 } | 105 } |
| 106 | 106 |
| 107 function didShowOriginalUISourceCode(sourceFrame) | 107 function didShowOriginalUISourceCode(sourceFrame) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 uiSourceCode = sourceFrame._uiSourceCode; | 139 uiSourceCode = sourceFrame._uiSourceCode; |
| 140 | 140 |
| 141 InspectorTest.addResult("Setting breakpoint:"); | 141 InspectorTest.addResult("Setting breakpoint:"); |
| 142 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); | 142 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); |
| 143 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 143 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 144 } | 144 } |
| 145 | 145 |
| 146 function breakpointResolved(callback, breakpointId, locations) | 146 function breakpointResolved(callback, breakpointId, locations) |
| 147 { | 147 { |
| 148 var location = locations[0]; | 148 var location = locations[0]; |
| 149 script = WebInspector.debuggerModel.scriptForId(location.scriptI
d); | 149 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); |
| 150 | 150 |
| 151 dumpBreakpointStorageAndLocations(); | 151 dumpBreakpointStorageAndLocations(); |
| 152 InspectorTest.addResult("Editing source:"); | 152 InspectorTest.addResult("Editing source:"); |
| 153 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//")
; | 153 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//")
; |
| 154 | 154 |
| 155 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; | 155 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; |
| 156 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); | 156 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); |
| 157 } | 157 } |
| 158 | 158 |
| 159 function didShowOriginalUISourceCode(sourceFrame) | 159 function didShowOriginalUISourceCode(sourceFrame) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 uiSourceCode = sourceFrame._uiSourceCode; | 191 uiSourceCode = sourceFrame._uiSourceCode; |
| 192 | 192 |
| 193 InspectorTest.addResult("Setting breakpoint:"); | 193 InspectorTest.addResult("Setting breakpoint:"); |
| 194 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); | 194 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); |
| 195 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 195 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 196 } | 196 } |
| 197 | 197 |
| 198 function breakpointResolved(callback, breakpointId, locations) | 198 function breakpointResolved(callback, breakpointId, locations) |
| 199 { | 199 { |
| 200 var location = locations[0]; | 200 var location = locations[0]; |
| 201 script = WebInspector.debuggerModel.scriptForId(location.scriptI
d); | 201 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); |
| 202 | 202 |
| 203 dumpBreakpointStorageAndLocations(); | 203 dumpBreakpointStorageAndLocations(); |
| 204 InspectorTest.addResult("Editing source:"); | 204 InspectorTest.addResult("Editing source:"); |
| 205 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}")
; | 205 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}")
; |
| 206 | 206 |
| 207 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; | 207 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; |
| 208 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); | 208 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); |
| 209 } | 209 } |
| 210 | 210 |
| 211 function didShowOriginalUISourceCode(sourceFrame) | 211 function didShowOriginalUISourceCode(sourceFrame) |
| 212 { | 212 { |
| 213 originalJavaScriptSourceFrame = sourceFrame; | 213 originalJavaScriptSourceFrame = sourceFrame; |
| 214 InspectorTest.assertTrue(originalJavaScriptSourceFrame !== javaS
criptSourceFrame, "Edited and original javaScriptSourceFrames should differ."); | 214 InspectorTest.assertTrue(originalJavaScriptSourceFrame !== javaS
criptSourceFrame, "Edited and original javaScriptSourceFrames should differ."); |
| 215 InspectorTest.assertTrue(originalUISourceCode !== uiSourceCode,
"Edited and original uiSourceCodes should differ."); | 215 InspectorTest.assertTrue(originalUISourceCode !== uiSourceCode,
"Edited and original uiSourceCodes should differ."); |
| 216 | 216 |
| 217 dumpBreakpointStorageAndLocations(); | 217 dumpBreakpointStorageAndLocations(); |
| 218 InspectorTest.addResult("Committing edited source:"); | 218 InspectorTest.addResult("Committing edited source:"); |
| 219 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditSc
riptSource", commitFailed); | 219 InspectorTest.addSniffer(InspectorTest.debuggerModel, "_didEditS
criptSource", commitFailed); |
| 220 InspectorTest.commitSource(javaScriptSourceFrame); | 220 InspectorTest.commitSource(javaScriptSourceFrame); |
| 221 } | 221 } |
| 222 | 222 |
| 223 function commitFailed(error) | 223 function commitFailed(error) |
| 224 { | 224 { |
| 225 InspectorTest.assertTrue(!!error, "Commit should have failed."); | 225 InspectorTest.assertTrue(!!error, "Commit should have failed."); |
| 226 dumpBreakpointStorageAndLocations(); | 226 dumpBreakpointStorageAndLocations(); |
| 227 InspectorTest.addResult("Editing source again so that live edit
could succeed:"); | 227 InspectorTest.addResult("Editing source again so that live edit
could succeed:"); |
| 228 InspectorTest.replaceInSource(javaScriptSourceFrame, "//}", "}//
"); | 228 InspectorTest.replaceInSource(javaScriptSourceFrame, "//}", "}//
"); |
| 229 | 229 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 256 uiSourceCode = sourceFrame._uiSourceCode; | 256 uiSourceCode = sourceFrame._uiSourceCode; |
| 257 | 257 |
| 258 InspectorTest.addResult("Setting breakpoint:"); | 258 InspectorTest.addResult("Setting breakpoint:"); |
| 259 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); | 259 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); |
| 260 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 260 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 261 } | 261 } |
| 262 | 262 |
| 263 function breakpointResolved(callback, breakpointId, locations) | 263 function breakpointResolved(callback, breakpointId, locations) |
| 264 { | 264 { |
| 265 var location = locations[0]; | 265 var location = locations[0]; |
| 266 script = WebInspector.debuggerModel.scriptForId(location.scriptI
d); | 266 script = InspectorTest.debuggerModel.scriptForId(location.script
Id); |
| 267 | 267 |
| 268 dumpBreakpointStorageAndLocations(); | 268 dumpBreakpointStorageAndLocations(); |
| 269 InspectorTest.addResult("Editing source:"); | 269 InspectorTest.addResult("Editing source:"); |
| 270 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}")
; | 270 InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}")
; |
| 271 | 271 |
| 272 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; | 272 originalUISourceCode = WebInspector.debuggerWorkspaceBinding.raw
LocationToUILocation(location).uiSourceCode; |
| 273 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); | 273 InspectorTest.showUISourceCode(originalUISourceCode, didShowOrig
inalUISourceCode); |
| 274 } | 274 } |
| 275 | 275 |
| 276 function didShowOriginalUISourceCode(sourceFrame) | 276 function didShowOriginalUISourceCode(sourceFrame) |
| 277 { | 277 { |
| 278 originalJavaScriptSourceFrame = sourceFrame; | 278 originalJavaScriptSourceFrame = sourceFrame; |
| 279 InspectorTest.assertTrue(originalJavaScriptSourceFrame !== javaS
criptSourceFrame, "Edited and original javaScriptSourceFrames should differ."); | 279 InspectorTest.assertTrue(originalJavaScriptSourceFrame !== javaS
criptSourceFrame, "Edited and original javaScriptSourceFrames should differ."); |
| 280 InspectorTest.assertTrue(originalUISourceCode !== uiSourceCode,
"Edited and original uiSourceCodes should differ."); | 280 InspectorTest.assertTrue(originalUISourceCode !== uiSourceCode,
"Edited and original uiSourceCodes should differ."); |
| 281 | 281 |
| 282 dumpBreakpointStorageAndLocations(); | 282 dumpBreakpointStorageAndLocations(); |
| 283 InspectorTest.addResult("Committing edited source:"); | 283 InspectorTest.addResult("Committing edited source:"); |
| 284 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditSc
riptSource", commitFailed); | 284 InspectorTest.addSniffer(InspectorTest.debuggerModel, "_didEditS
criptSource", commitFailed); |
| 285 InspectorTest.commitSource(javaScriptSourceFrame); | 285 InspectorTest.commitSource(javaScriptSourceFrame); |
| 286 } | 286 } |
| 287 | 287 |
| 288 function commitFailed(error) | 288 function commitFailed(error) |
| 289 { | 289 { |
| 290 InspectorTest.assertTrue(!!error, "Commit should have failed."); | 290 InspectorTest.assertTrue(!!error, "Commit should have failed."); |
| 291 dumpBreakpointStorageAndLocations(); | 291 dumpBreakpointStorageAndLocations(); |
| 292 InspectorTest.addResult("Undoing source editing:"); | 292 InspectorTest.addResult("Undoing source editing:"); |
| 293 InspectorTest.undoSourceEditing(javaScriptSourceFrame); | 293 InspectorTest.undoSourceEditing(javaScriptSourceFrame); |
| 294 | 294 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 311 ]); | 311 ]); |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 </script> | 314 </script> |
| 315 </head> | 315 </head> |
| 316 <body onload="runTest()"> | 316 <body onload="runTest()"> |
| 317 <p>Tests breakpoints are correctly dimmed and restored in JavaScriptSourceFrame
during live edit.</p> | 317 <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> | 318 <a href="https://bugs.webkit.org/show_bug.cgi?id=99598">Bug 99598</a> |
| 319 </body> | 319 </body> |
| 320 </html> | 320 </html> |
| OLD | NEW |