Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js

Issue 2376583002: DevTools: remove WI.NetworkMapping.networkURL (Closed)
Patch Set: do not blackbox fs uiSourceCodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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)
11 { 11 {
12 return InspectorTest.uiSourceCodes[rawLocation.scriptId].uiLocation( rawLocation.lineNumber, 0); 12 return InspectorTest.uiSourceCodes[rawLocation.scriptId].uiLocation( rawLocation.lineNumber, 0);
13 }, 13 },
14 14
15 uiLocationToRawLocation: function(uiSourceCode, lineNumber) 15 uiLocationToRawLocation: function(uiSourceCode, lineNumber)
16 { 16 {
17 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiSourc eCode); 17 if (!InspectorTest.uiSourceCodes[uiSourceCode.url()])
18 if (!InspectorTest.uiSourceCodes[networkURL])
19 return null; 18 return null;
20 return new WebInspector.DebuggerModel.Location(target.debuggerModel, networkURL, lineNumber, 0); 19 return new WebInspector.DebuggerModel.Location(target.debuggerModel, uiSourceCode.url(), lineNumber, 0);
21 }, 20 },
22 21
23 isIdentity: function() 22 isIdentity: function()
24 { 23 {
25 return true; 24 return true;
26 } 25 }
27 }; 26 };
28 target.defaultMapping = defaultMapping; 27 target.defaultMapping = defaultMapping;
29 } 28 }
30 29
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 }, true); 199 }, true);
201 } 200 }
202 201
203 InspectorTest.addScript = function(target, breakpointManager, url) 202 InspectorTest.addScript = function(target, breakpointManager, url)
204 { 203 {
205 target.debuggerModel._addScript(url, url); 204 target.debuggerModel._addScript(url, url);
206 InspectorTest.addResult(" Adding script: " + url); 205 InspectorTest.addResult(" Adding script: " + url);
207 var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType (WebInspector.projectTypes.Debugger); 206 var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType (WebInspector.projectTypes.Debugger);
208 for (var i = 0; i < uiSourceCodes.length; ++i) { 207 for (var i = 0; i < uiSourceCodes.length; ++i) {
209 var uiSourceCode = uiSourceCodes[i]; 208 var uiSourceCode = uiSourceCodes[i];
210 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiSourceCod e); 209 if (uiSourceCode.url() === url) {
211 if (networkURL === url) {
212 breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCode, breakpointManager.defaultMapping); 210 breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCode, breakpointManager.defaultMapping);
213 InspectorTest.uiSourceCodes[url] = uiSourceCode; 211 InspectorTest.uiSourceCodes[url] = uiSourceCode;
214 return uiSourceCode; 212 return uiSourceCode;
215 } 213 }
216 } 214 }
217 } 215 }
218 216
219 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript) 217 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript)
220 { 218 {
221 if (!doNotAddScript) 219 if (!doNotAddScript)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceC ode.url(), uiLocation.lineNumber, uiLocation.columnNumber].join(", ") + ")"); 266 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceC ode.url(), uiLocation.lineNumber, uiLocation.columnNumber].join(", ") + ")");
269 } 267 }
270 var targets = targetManager.targets(); 268 var targets = targetManager.targets();
271 var mappingForManager; 269 var mappingForManager;
272 for (var i = 0; i < targets.length; ++i) { 270 for (var i = 0; i < targets.length; ++i) {
273 InspectorTest.initializeDefaultMappingOnTarget(targets[i]); 271 InspectorTest.initializeDefaultMappingOnTarget(targets[i]);
274 if (!mappingForManager) 272 if (!mappingForManager)
275 mappingForManager = targets[i].defaultMapping; 273 mappingForManager = targets[i].defaultMapping;
276 } 274 }
277 275
278 var breakpointManager = new WebInspector.BreakpointManager(setting, debugger WorkspaceBinding._workspace, debuggerWorkspaceBinding._networkMapping, targetMan ager, debuggerWorkspaceBinding); 276 var breakpointManager = new WebInspector.BreakpointManager(setting, debugger WorkspaceBinding._workspace, targetManager, debuggerWorkspaceBinding);
279 breakpointManager.defaultMapping = mappingForManager; 277 breakpointManager.defaultMapping = mappingForManager;
280 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre akpointAdded, breakpointAdded); 278 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre akpointAdded, breakpointAdded);
281 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre akpointRemoved, breakpointRemoved); 279 breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.Bre akpointRemoved, breakpointRemoved);
282 InspectorTest.addResult(" Created breakpoints manager"); 280 InspectorTest.addResult(" Created breakpoints manager");
283 InspectorTest.dumpBreakpointStorage(breakpointManager); 281 InspectorTest.dumpBreakpointStorage(breakpointManager);
284 return breakpointManager; 282 return breakpointManager;
285 } 283 }
286 284
287 InspectorTest.setBreakpoint = function(breakpointManager, uiSourceCode, lineNumb er, columnNumber, condition, enabled, setBreakpointCallback) 285 InspectorTest.setBreakpoint = function(breakpointManager, uiSourceCode, lineNumb er, columnNumber, condition, enabled, setBreakpointCallback)
288 { 286 {
(...skipping 22 matching lines...) Expand all
311 var allBreakpointLocations = breakpointManager.allBreakpointLocations(); 309 var allBreakpointLocations = breakpointManager.allBreakpointLocations();
312 InspectorTest.addResult(" Dumping Breakpoint Locations"); 310 InspectorTest.addResult(" Dumping Breakpoint Locations");
313 var lastUISourceCode = null; 311 var lastUISourceCode = null;
314 var locations = []; 312 var locations = [];
315 313
316 function dumpLocations(uiSourceCode, locations) 314 function dumpLocations(uiSourceCode, locations)
317 { 315 {
318 locations.sort(function(a, b) { 316 locations.sort(function(a, b) {
319 return a.lineNumber - b.lineNumber; 317 return a.lineNumber - b.lineNumber;
320 }); 318 });
321 var networkURL = InspectorTest.testNetworkMapping.networkURL(uiSourceCod e); 319 InspectorTest.addResult(" UISourceCode (url='" + uiSourceCode.url() + "', uri='" + uiSourceCode.url() + "')");
322 InspectorTest.addResult(" UISourceCode (url='" + networkURL + "', uri ='" + uiSourceCode.url() + "')");
323 for (var i = 0; i < locations.length; ++i) 320 for (var i = 0; i < locations.length; ++i)
324 InspectorTest.addResult(" Location: (" + locations[i].lineNumbe r + ", " + locations[i].columnNumber + ")"); 321 InspectorTest.addResult(" Location: (" + locations[i].lineNumbe r + ", " + locations[i].columnNumber + ")");
325 } 322 }
326 323
327 for (var i = 0; i < allBreakpointLocations.length; ++i) { 324 for (var i = 0; i < allBreakpointLocations.length; ++i) {
328 var uiLocation = allBreakpointLocations[i].uiLocation; 325 var uiLocation = allBreakpointLocations[i].uiLocation;
329 var uiSourceCode = uiLocation.uiSourceCode; 326 var uiSourceCode = uiLocation.uiSourceCode;
330 if (lastUISourceCode && lastUISourceCode != uiSourceCode) { 327 if (lastUISourceCode && lastUISourceCode != uiSourceCode) {
331 dumpLocations(uiSourceCode, locations); 328 dumpLocations(uiSourceCode, locations);
332 locations = []; 329 locations = [];
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 381 }
385 382
386 function finish() 383 function finish()
387 { 384 {
388 InspectorTest.dumpBreakpointLocations(breakpointManager); 385 InspectorTest.dumpBreakpointLocations(breakpointManager);
389 next(); 386 next();
390 } 387 }
391 } 388 }
392 389
393 } 390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698