| OLD | NEW |
| 1 var initialize_BreakpointManagerTest = function() { | 1 var initialize_BreakpointManagerTest = function() { |
| 2 | 2 |
| 3 InspectorTest.uiSourceCodes = {}; | 3 InspectorTest.uiSourceCodes = {}; |
| 4 | 4 |
| 5 InspectorTest.dumpTargetIds = false; | 5 InspectorTest.dumpTargetIds = false; |
| 6 | 6 |
| 7 InspectorTest.initializeDefaultMappingOnTarget = function(target) | 7 InspectorTest.initializeDefaultMappingOnTarget = function(target) |
| 8 { | 8 { |
| 9 var defaultMapping = { | 9 var defaultMapping = { |
| 10 rawLocationToUILocation: function(rawLocation) | 10 rawLocationToUILocation: function(rawLocation) |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 persistentBreakpoints = persistentBreakpoints || []; | 250 persistentBreakpoints = persistentBreakpoints || []; |
| 251 var setting = { | 251 var setting = { |
| 252 get: function() { return persistentBreakpoints; }, | 252 get: function() { return persistentBreakpoints; }, |
| 253 set: function(breakpoints) { persistentBreakpoints = breakpoints; } | 253 set: function(breakpoints) { persistentBreakpoints = breakpoints; } |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 function breakpointAdded(event) | 256 function breakpointAdded(event) |
| 257 { | 257 { |
| 258 var breakpoint = event.data.breakpoint; | 258 var breakpoint = event.data.breakpoint; |
| 259 var uiLocation = event.data.uiLocation; | 259 var uiLocation = event.data.uiLocation; |
| 260 InspectorTest.addResult(" breakpointAdded(" + [uiLocation.uiSourceCod
e.originURL(), uiLocation.lineNumber, uiLocation.columnNumber, breakpoint.condit
ion(), breakpoint.enabled()].join(", ") + ")"); | 260 InspectorTest.addResult(" breakpointAdded(" + [uiLocation.uiSourceCod
e.url(), uiLocation.lineNumber, uiLocation.columnNumber, breakpoint.condition(),
breakpoint.enabled()].join(", ") + ")"); |
| 261 } | 261 } |
| 262 | 262 |
| 263 function breakpointRemoved(event) | 263 function breakpointRemoved(event) |
| 264 { | 264 { |
| 265 var uiLocation = event.data.uiLocation; | 265 var uiLocation = event.data.uiLocation; |
| 266 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceC
ode.originURL(), uiLocation.lineNumber, uiLocation.columnNumber].join(", ") + ")
"); | 266 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceC
ode.url(), uiLocation.lineNumber, uiLocation.columnNumber].join(", ") + ")"); |
| 267 } | 267 } |
| 268 var targets = targetManager.targets(); | 268 var targets = targetManager.targets(); |
| 269 var mappingForManager; | 269 var mappingForManager; |
| 270 for (var i = 0; i < targets.length; ++i) { | 270 for (var i = 0; i < targets.length; ++i) { |
| 271 InspectorTest.initializeDefaultMappingOnTarget(targets[i]); | 271 InspectorTest.initializeDefaultMappingOnTarget(targets[i]); |
| 272 if (!mappingForManager) | 272 if (!mappingForManager) |
| 273 mappingForManager = targets[i].defaultMapping; | 273 mappingForManager = targets[i].defaultMapping; |
| 274 } | 274 } |
| 275 | 275 |
| 276 var breakpointManager = new WebInspector.BreakpointManager(setting, debugger
WorkspaceBinding._workspace, debuggerWorkspaceBinding._networkMapping, targetMan
ager, debuggerWorkspaceBinding); | 276 var breakpointManager = new WebInspector.BreakpointManager(setting, debugger
WorkspaceBinding._workspace, debuggerWorkspaceBinding._networkMapping, targetMan
ager, debuggerWorkspaceBinding); |
| 277 breakpointManager.defaultMapping = mappingForManager; | 277 breakpointManager.defaultMapping = mappingForManager; |
| 278 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre
akpointAdded, breakpointAdded); | 278 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre
akpointAdded, breakpointAdded); |
| 279 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre
akpointRemoved, breakpointRemoved); | 279 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre
akpointRemoved, breakpointRemoved); |
| 280 InspectorTest.addResult(" Created breakpoints manager"); | 280 InspectorTest.addResult(" Created breakpoints manager"); |
| 281 InspectorTest.dumpBreakpointStorage(breakpointManager); | 281 InspectorTest.dumpBreakpointStorage(breakpointManager); |
| 282 return breakpointManager; | 282 return breakpointManager; |
| 283 } | 283 } |
| 284 | 284 |
| 285 InspectorTest.setBreakpoint = function(breakpointManager, uiSourceCode, lineNumb
er, columnNumber, condition, enabled, setBreakpointCallback) | 285 InspectorTest.setBreakpoint = function(breakpointManager, uiSourceCode, lineNumb
er, columnNumber, condition, enabled, setBreakpointCallback) |
| 286 { | 286 { |
| 287 InspectorTest.addResult(" Setting breakpoint at " + uiSourceCode.originURL(
) + ":" + lineNumber + ":" + columnNumber + " enabled:" + enabled + " condition:
" + condition); | 287 InspectorTest.addResult(" Setting breakpoint at " + uiSourceCode.url() + ":
" + lineNumber + ":" + columnNumber + " enabled:" + enabled + " condition:" + co
ndition); |
| 288 if (setBreakpointCallback) | 288 if (setBreakpointCallback) |
| 289 window.setBreakpointCallback = setBreakpointCallback; | 289 window.setBreakpointCallback = setBreakpointCallback; |
| 290 return breakpointManager.setBreakpoint(uiSourceCode, lineNumber, columnNumbe
r, condition, enabled); | 290 return breakpointManager.setBreakpoint(uiSourceCode, lineNumber, columnNumbe
r, condition, enabled); |
| 291 } | 291 } |
| 292 | 292 |
| 293 InspectorTest.removeBreakpoint = function(breakpointManager, uiSourceCode, lineN
umber, columnNumber) | 293 InspectorTest.removeBreakpoint = function(breakpointManager, uiSourceCode, lineN
umber, columnNumber) |
| 294 { | 294 { |
| 295 InspectorTest.addResult(" Removing breakpoint at " + uiSourceCode.originURL
() + ":" + lineNumber + ":" + columnNumber); | 295 InspectorTest.addResult(" Removing breakpoint at " + uiSourceCode.url() + "
:" + lineNumber + ":" + columnNumber); |
| 296 breakpointManager.findBreakpoint(uiSourceCode, lineNumber, columnNumber).rem
ove(); | 296 breakpointManager.findBreakpoint(uiSourceCode, lineNumber, columnNumber).rem
ove(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 InspectorTest.dumpBreakpointStorage = function(breakpointManager) | 299 InspectorTest.dumpBreakpointStorage = function(breakpointManager) |
| 300 { | 300 { |
| 301 var breakpoints = breakpointManager._storage._setting.get(); | 301 var breakpoints = breakpointManager._storage._setting.get(); |
| 302 InspectorTest.addResult(" Dumping Storage"); | 302 InspectorTest.addResult(" Dumping Storage"); |
| 303 for (var i = 0; i < breakpoints.length; ++i) | 303 for (var i = 0; i < breakpoints.length; ++i) |
| 304 InspectorTest.addResult(" " + breakpoints[i].sourceFileId + ":" + bre
akpoints[i].lineNumber + " enabled:" + breakpoints[i].enabled + " condition:" +
breakpoints[i].condition); | 304 InspectorTest.addResult(" " + breakpoints[i].sourceFileId + ":" + bre
akpoints[i].lineNumber + " enabled:" + breakpoints[i].enabled + " condition:" +
breakpoints[i].condition); |
| 305 } | 305 } |
| 306 | 306 |
| 307 InspectorTest.dumpBreakpointLocations = function(breakpointManager) | 307 InspectorTest.dumpBreakpointLocations = function(breakpointManager) |
| 308 { | 308 { |
| 309 var allBreakpointLocations = breakpointManager.allBreakpointLocations(); | 309 var allBreakpointLocations = breakpointManager.allBreakpointLocations(); |
| 310 InspectorTest.addResult(" Dumping Breakpoint Locations"); | 310 InspectorTest.addResult(" Dumping Breakpoint Locations"); |
| 311 var lastUISourceCode = null; | 311 var lastUISourceCode = null; |
| 312 var locations = []; | 312 var locations = []; |
| 313 | 313 |
| 314 function dumpLocations(uiSourceCode, locations) | 314 function dumpLocations(uiSourceCode, locations) |
| 315 { | 315 { |
| 316 locations.sort(function(a, b) { | 316 locations.sort(function(a, b) { |
| 317 return a.lineNumber - b.lineNumber; | 317 return a.lineNumber - b.lineNumber; |
| 318 }); | 318 }); |
| 319 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiSourceCod
e); | 319 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiSourceCod
e); |
| 320 InspectorTest.addResult(" UISourceCode (url='" + networkURL + "', uri
='" + uiSourceCode.uri() + "')"); | 320 InspectorTest.addResult(" UISourceCode (url='" + networkURL + "', uri
='" + uiSourceCode.url() + "')"); |
| 321 for (var i = 0; i < locations.length; ++i) | 321 for (var i = 0; i < locations.length; ++i) |
| 322 InspectorTest.addResult(" Location: (" + locations[i].lineNumbe
r + ", " + locations[i].columnNumber + ")"); | 322 InspectorTest.addResult(" Location: (" + locations[i].lineNumbe
r + ", " + locations[i].columnNumber + ")"); |
| 323 } | 323 } |
| 324 | 324 |
| 325 for (var i = 0; i < allBreakpointLocations.length; ++i) { | 325 for (var i = 0; i < allBreakpointLocations.length; ++i) { |
| 326 var uiLocation = allBreakpointLocations[i].uiLocation; | 326 var uiLocation = allBreakpointLocations[i].uiLocation; |
| 327 var uiSourceCode = uiLocation.uiSourceCode; | 327 var uiSourceCode = uiLocation.uiSourceCode; |
| 328 if (lastUISourceCode && lastUISourceCode != uiSourceCode) { | 328 if (lastUISourceCode && lastUISourceCode != uiSourceCode) { |
| 329 dumpLocations(uiSourceCode, locations); | 329 dumpLocations(uiSourceCode, locations); |
| 330 locations = []; | 330 locations = []; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 | 383 |
| 384 function finish() | 384 function finish() |
| 385 { | 385 { |
| 386 InspectorTest.dumpBreakpointLocations(breakpointManager); | 386 InspectorTest.dumpBreakpointLocations(breakpointManager); |
| 387 next(); | 387 next(); |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 } | 391 } |
| OLD | NEW |