OLD | NEW |
1 var initialize_WorkspaceTest = function() { | 1 var initialize_WorkspaceTest = function() { |
2 | 2 |
3 InspectorTest.createWorkspace = function(ignoreEvents) | 3 InspectorTest.createWorkspace = function(ignoreEvents) |
4 { | 4 { |
5 if (InspectorTest.testFileSystemWorkspaceBinding) | 5 if (InspectorTest.testFileSystemWorkspaceBinding) |
6 InspectorTest.testFileSystemWorkspaceBinding.dispose(); | 6 InspectorTest.testFileSystemWorkspaceBinding.dispose(); |
7 if (InspectorTest.testNetworkMapping) | 7 if (InspectorTest.testNetworkMapping) |
8 InspectorTest.testNetworkMapping.dispose(); | 8 InspectorTest.testNetworkMapping.dispose(); |
9 WebInspector.fileSystemMapping.resetForTesting(); | 9 WebInspector.fileSystemMapping.resetForTesting(); |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 InspectorTest._mockTargetId = 1; | 36 InspectorTest._mockTargetId = 1; |
37 InspectorTest._pageCapabilities = | 37 InspectorTest._pageCapabilities = |
38 WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM
| | 38 WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM
| |
39 WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log | | 39 WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log | |
40 WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Work
er; | 40 WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Work
er; |
41 | 41 |
42 InspectorTest.createMockTarget = function(id, debuggerModelConstructor, capabili
ties) | 42 InspectorTest.createMockTarget = function(id, debuggerModelConstructor, capabili
ties) |
43 { | 43 { |
44 capabilities = capabilities || InspectorTest._pageCapabilities; | 44 capabilities = capabilities || InspectorTest._pageCapabilities; |
45 var MockTarget = function(name, connectionFactory, callback) | 45 var MockTarget = class extends WebInspector.Target { |
46 { | 46 constructor(name, connectionFactory, callback) { |
47 WebInspector.Target.call(this, InspectorTest.testTargetManager, name, ca
pabilities, connectionFactory, null, callback); | 47 super(InspectorTest.testTargetManager, name, capabilities, connectio
nFactory, null, callback); |
48 this._inspectedURL = InspectorTest.mainTarget.inspectedURL(); | 48 this._inspectedURL = InspectorTest.mainTarget.inspectedURL(); |
49 this.consoleModel = new WebInspector.ConsoleModel(this); | 49 this.consoleModel = new WebInspector.ConsoleModel(this); |
50 this.networkManager = new WebInspector.NetworkManager(this); | 50 this.networkManager = new WebInspector.NetworkManager(this); |
51 this.runtimeModel = new WebInspector.RuntimeModel(this); | 51 this.runtimeModel = new WebInspector.RuntimeModel(this); |
52 this.securityOriginManager = WebInspector.SecurityOriginManager.fromTarg
et(this); | 52 this.securityOriginManager = WebInspector.SecurityOriginManager.from
Target(this); |
53 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this, this.n
etworkManager, this.securityOriginManager); | 53 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this, th
is.networkManager, this.securityOriginManager); |
54 this.resourceTreeModel._cachedResourcesProcessed = true; | 54 this.resourceTreeModel._cachedResourcesProcessed = true; |
55 this.resourceTreeModel._frameAttached("42", 0); | 55 this.resourceTreeModel._frameAttached("42", 0); |
56 this.debuggerModel = debuggerModelConstructor ? new debuggerModelConstru
ctor(this) : new WebInspector.DebuggerModel(this); | 56 this.debuggerModel = debuggerModelConstructor ? new debuggerModelCon
structor(this) : new WebInspector.DebuggerModel(this); |
57 this._modelByConstructor.set(WebInspector.DebuggerModel, this.debuggerMo
del); | 57 this._modelByConstructor.set(WebInspector.DebuggerModel, this.debugg
erModel); |
58 this.domModel = new WebInspector.DOMModel(this); | 58 this.domModel = new WebInspector.DOMModel(this); |
59 this.cssModel = new WebInspector.CSSModel(this, this.domModel); | 59 this.cssModel = new WebInspector.CSSModel(this, this.domModel); |
60 } | 60 } |
61 | 61 |
62 MockTarget.prototype = { | 62 _loadedWithCapabilities() |
63 _loadedWithCapabilities: function() | |
64 { | 63 { |
65 }, | 64 } |
66 | 65 }; |
67 __proto__: WebInspector.Target.prototype | |
68 } | |
69 | 66 |
70 var target = new MockTarget("mock-target-" + id, (params) => new WebInspecto
r.StubConnection(params)); | 67 var target = new MockTarget("mock-target-" + id, (params) => new WebInspecto
r.StubConnection(params)); |
71 InspectorTest.testTargetManager.addTarget(target); | 68 InspectorTest.testTargetManager.addTarget(target); |
72 return target; | 69 return target; |
73 } | 70 } |
74 | 71 |
75 InspectorTest.createWorkspaceWithTarget = function(ignoreEvents) | 72 InspectorTest.createWorkspaceWithTarget = function(ignoreEvents) |
76 { | 73 { |
77 InspectorTest.createWorkspace(ignoreEvents); | 74 InspectorTest.createWorkspace(ignoreEvents); |
78 var target = InspectorTest.createMockTarget(InspectorTest._mockTargetId++); | 75 var target = InspectorTest.createMockTarget(InspectorTest._mockTargetId++); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 function uiSourceCodeAdded(event) | 186 function uiSourceCodeAdded(event) |
190 { | 187 { |
191 if (event.data.name() === name) { | 188 if (event.data.name() === name) { |
192 WebInspector.workspace.removeEventListener(WebInspector.Workspace.Ev
ents.UISourceCodeAdded, uiSourceCodeAdded); | 189 WebInspector.workspace.removeEventListener(WebInspector.Workspace.Ev
ents.UISourceCodeAdded, uiSourceCodeAdded); |
193 setImmediate(callback); | 190 setImmediate(callback); |
194 } | 191 } |
195 } | 192 } |
196 } | 193 } |
197 | 194 |
198 }; | 195 }; |
OLD | NEW |