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

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

Issue 2931773002: DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping (Closed)
Patch Set: address comments Created 3 years, 6 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.createWorkspace = function() 3 InspectorTest.createWorkspace = function()
4 { 4 {
5 InspectorTest.testTargetManager = new SDK.TargetManager(); 5 InspectorTest.testTargetManager = new SDK.TargetManager();
6 InspectorTest.testWorkspace = new Workspace.Workspace(); 6 InspectorTest.testWorkspace = new Workspace.Workspace();
7 InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager (InspectorTest.testTargetManager, InspectorTest.testWorkspace); 7 InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager (InspectorTest.testTargetManager, InspectorTest.testWorkspace);
8 InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceB inding(InspectorTest.testTargetManager, InspectorTest.testWorkspace); 8 InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceB inding(InspectorTest.testTargetManager, InspectorTest.testWorkspace);
9 } 9 }
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return this._scripts[scriptId]; 176 return this._scripts[scriptId];
177 } 177 }
178 178
179 reset() 179 reset()
180 { 180 {
181 InspectorTest.addResult(" Resetting debugger."); 181 InspectorTest.addResult(" Resetting debugger.");
182 this._scripts = {}; 182 this._scripts = {};
183 this._debuggerWorkspaceBinding._reset(this); 183 this._debuggerWorkspaceBinding._reset(this);
184 } 184 }
185 185
186 pushSourceMapping(sourceMapping)
187 {
188 for (var scriptId in this._scripts)
189 this._debuggerWorkspaceBinding.pushSourceMapping(this._scripts[scrip tId], sourceMapping);
190 }
191
192 disableSourceMapping(sourceMapping)
193 {
194 sourceMapping._disabled = true;
195 for (var scriptId in this._scripts)
196 this._debuggerWorkspaceBinding.updateLocations(this._scripts[scriptI d]);
197 }
198
199 addBreakpointListener(breakpointId, listener, thisObject) 186 addBreakpointListener(breakpointId, listener, thisObject)
200 { 187 {
201 this._breakpointResolvedEventTarget.addEventListener(breakpointId, liste ner, thisObject) 188 this._breakpointResolvedEventTarget.addEventListener(breakpointId, liste ner, thisObject)
202 } 189 }
203 190
204 removeBreakpointListener(breakpointId, listener, thisObject) 191 removeBreakpointListener(breakpointId, listener, thisObject)
205 { 192 {
206 this._breakpointResolvedEventTarget.removeEventListener(breakpointId, li stener, thisObject); 193 this._breakpointResolvedEventTarget.removeEventListener(breakpointId, li stener, thisObject);
207 } 194 }
208 195
(...skipping 16 matching lines...) Expand all
225 } 212 }
226 213
227 InspectorTest.addScript = function(target, breakpointManager, url) 214 InspectorTest.addScript = function(target, breakpointManager, url)
228 { 215 {
229 target.debuggerModel._addScript(url, url); 216 target.debuggerModel._addScript(url, url);
230 InspectorTest.addResult(" Adding script: " + url); 217 InspectorTest.addResult(" Adding script: " + url);
231 var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType (Workspace.projectTypes.Debugger); 218 var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType (Workspace.projectTypes.Debugger);
232 for (var i = 0; i < uiSourceCodes.length; ++i) { 219 for (var i = 0; i < uiSourceCodes.length; ++i) {
233 var uiSourceCode = uiSourceCodes[i]; 220 var uiSourceCode = uiSourceCodes[i];
234 if (uiSourceCode.url() === url) { 221 if (uiSourceCode.url() === url) {
235 breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target. debuggerModel, uiSourceCode, breakpointManager.defaultMapping);
236 InspectorTest.uiSourceCodes[url] = uiSourceCode; 222 InspectorTest.uiSourceCodes[url] = uiSourceCode;
237 return uiSourceCode; 223 return uiSourceCode;
238 } 224 }
239 } 225 }
240 } 226 }
241 227
242 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript) 228 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript)
243 { 229 {
244 if (!doNotAddScript) 230 if (!doNotAddScript)
245 InspectorTest.addScript(target, breakpointManager, url); 231 InspectorTest.addScript(target, breakpointManager, url);
246 InspectorTest.addResult(" Adding UISourceCode: " + url); 232 InspectorTest.addResult(" Adding UISourceCode: " + url);
247 233
248 // Add resource to get UISourceCode. 234 // Add resource to get UISourceCode.
249 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url); 235 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url);
250 if (uiSourceCode) 236 if (uiSourceCode)
251 uiSourceCode.project().removeFile(url); 237 uiSourceCode.project().removeFile(url);
252 var resource = new SDK.Resource(target, null, url, url, '', '', Common.resou rceTypes.Document, 'text/html', null, null); 238 var resource = new SDK.Resource(target, null, url, url, '', '', Common.resou rceTypes.Document, 'text/html', null, null);
253 InspectorTest.testNetworkProject._addResource(resource); 239 InspectorTest.testNetworkProject._addResource(resource);
254 uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url); 240 uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url);
255 241
256 //var contentProvider = Common.StaticContentProvider.fromString(url, Common. resourceTypes.Script, "");
257 //var uiSourceCode = InspectorTest.testNetworkProject.addFile(contentProvide r, null);
258 InspectorTest.uiSourceCodes[url] = uiSourceCode; 242 InspectorTest.uiSourceCodes[url] = uiSourceCode;
259 if (!doNotSetSourceMapping) { 243 if (!doNotSetSourceMapping) {
260 breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target.debu ggerModel, uiSourceCode, breakpointManager.defaultMapping);
261 breakpointManager._debuggerWorkspaceBinding.updateLocations(target.debug gerModel.scriptForId(url)); 244 breakpointManager._debuggerWorkspaceBinding.updateLocations(target.debug gerModel.scriptForId(url));
262 } 245 }
263 return uiSourceCode; 246 return uiSourceCode;
264 } 247 }
265 248
266 InspectorTest.createBreakpointManager = function(targetManager, debuggerWorkspac eBinding, persistentBreakpoints) 249 InspectorTest.createBreakpointManager = function(targetManager, debuggerWorkspac eBinding, persistentBreakpoints)
267 { 250 {
268 InspectorTest._pendingBreakpointUpdates = 0; 251 InspectorTest._pendingBreakpointUpdates = 0;
269 InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototyp e, "_updateInDebugger", updateInDebugger, true); 252 InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototyp e, "_updateInDebugger", updateInDebugger, true);
270 InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototyp e, "_didUpdateInDebugger", didUpdateInDebugger, true); 253 InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototyp e, "_didUpdateInDebugger", didUpdateInDebugger, true);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 397 }
415 398
416 function finish() 399 function finish()
417 { 400 {
418 InspectorTest.dumpBreakpointLocations(breakpointManager); 401 InspectorTest.dumpBreakpointLocations(breakpointManager);
419 next(); 402 next();
420 } 403 }
421 } 404 }
422 405
423 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698