| Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
|
| index 5b2a98d6fbd5db05bd219c24a00e554598f374b7..4e33a4e79c9970c6f694d8f40ed6b329fa1d4f7b 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
|
| +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
|
| @@ -5,7 +5,16 @@ InspectorTest.createWorkspace = function()
|
| InspectorTest.testTargetManager = new SDK.TargetManager();
|
| InspectorTest.testWorkspace = new Workspace.Workspace();
|
| InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager(InspectorTest.testTargetManager, InspectorTest.testWorkspace);
|
| + InspectorTest.testResourceBindingManager = new Bindings.ResourceBindingManager(InspectorTest.testTargetManager, InspectorTest.testWorkspace);
|
| InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceBinding(InspectorTest.testTargetManager, InspectorTest.testWorkspace);
|
| + // Override resourceBindingManager so that CSSWorkspaceBinding and DebuggerWorkspaceBinding refer to the correct one.
|
| + Bindings.resourceBindingManager = InspectorTest.testResourceBindingManager;
|
| +}
|
| +
|
| +function resourceBindingForTarget(target) {
|
| + var resourceTreeModel = target.model(SDK.ResourceTreeModel);
|
| + var binding = resourceTreeModel ? InspectorTest.testResourceBindingManager._modelToBinding.get(resourceTreeModel) : null;
|
| + return binding;
|
| }
|
|
|
| InspectorTest.createMockTarget = function(id)
|
| @@ -13,6 +22,7 @@ InspectorTest.createMockTarget = function(id)
|
| var capabilities = SDK.Target.Capability.AllForTests;
|
| var target = InspectorTest.testTargetManager.createTarget("mock-target-id-" + id, "mock-target-" + id, capabilities & (~SDK.Target.Capability.JS), (params) => new SDK.StubConnection(params), null);
|
| InspectorTest.testNetworkProject = Bindings.NetworkProject.forTarget(target);
|
| + InspectorTest.testResourceBinding = resourceBindingForTarget(target);
|
| target._capabilitiesMask = capabilities;
|
| target._inspectedURL = InspectorTest.mainTarget.inspectedURL();
|
| target.resourceTreeModel = target.model(SDK.ResourceTreeModel);
|
| @@ -129,6 +139,8 @@ InspectorTest.DebuggerModelMock = class extends SDK.SDKModel {
|
| createRawLocationByURL(url, line, column)
|
| {
|
| var script = this._scriptForURL(url);
|
| + if (!script)
|
| + return null;
|
| return new SDK.DebuggerModel.Location(this, script.scriptId, line, column);
|
| }
|
|
|
| @@ -232,11 +244,13 @@ InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe
|
| InspectorTest.addResult(" Adding UISourceCode: " + url);
|
|
|
| // Add resource to get UISourceCode.
|
| - var uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url);
|
| - if (uiSourceCode)
|
| - uiSourceCode.project().removeFile(url);
|
| + var resourceBinding = resourceBindingForTarget(target);
|
| + if (resourceBinding._resourceFiles.has(url)) {
|
| + resourceBinding._resourceFiles.get(url).dispose();
|
| + resourceBinding._resourceFiles.delete(url);
|
| + }
|
| var resource = new SDK.Resource(target, null, url, url, '', '', Common.resourceTypes.Document, 'text/html', null, null);
|
| - InspectorTest.testNetworkProject._addResource(resource);
|
| + resourceBinding._resourceAdded({data: resource});
|
| uiSourceCode = InspectorTest.testWorkspace.uiSourceCodeForURL(url);
|
|
|
| InspectorTest.uiSourceCodes[url] = uiSourceCode;
|
|
|