OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 InspectorTest = {}; | 5 InspectorTest = {}; |
6 InspectorTest._dumpInspectorProtocolMessages = false; | 6 InspectorTest._dumpInspectorProtocolMessages = false; |
7 InspectorTest._commandsForLogging = new Set(); | 7 InspectorTest._commandsForLogging = new Set(); |
8 InspectorTest._sessions = new Set(); | 8 InspectorTest._sessions = new Set(); |
9 | 9 |
10 InspectorTest.log = utils.print.bind(utils); | 10 InspectorTest.log = utils.print.bind(utils); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 disconnect() { | 179 disconnect() { |
180 InspectorTest._sessions.delete(this); | 180 InspectorTest._sessions.delete(this); |
181 utils.disconnectSession(this.id); | 181 utils.disconnectSession(this.id); |
182 } | 182 } |
183 | 183 |
184 reconnect() { | 184 reconnect() { |
185 var state = utils.disconnectSession(this.id); | 185 var state = utils.disconnectSession(this.id); |
186 this.id = utils.connectSession(this.contextGroup.id, state, this._dispatchMe
ssage.bind(this)); | 186 this.id = utils.connectSession(this.contextGroup.id, state, this._dispatchMe
ssage.bind(this)); |
187 } | 187 } |
188 | 188 |
| 189 async addInspectedObject(serializable) { |
| 190 return this.Protocol.Runtime.evaluate({expression: `inspector.addInspectedOb
ject(${this.id}, ${JSON.stringify(serializable)})`}); |
| 191 } |
| 192 |
189 sendRawCommand(requestId, command, handler) { | 193 sendRawCommand(requestId, command, handler) { |
190 if (InspectorTest._dumpInspectorProtocolMessages) | 194 if (InspectorTest._dumpInspectorProtocolMessages) |
191 utils.print("frontend: " + command); | 195 utils.print("frontend: " + command); |
192 this._dispatchTable.set(requestId, handler); | 196 this._dispatchTable.set(requestId, handler); |
193 utils.sendMessageToBackend(this.id, command); | 197 utils.sendMessageToBackend(this.id, command); |
194 } | 198 } |
195 | 199 |
196 setupScriptMap() { | 200 setupScriptMap() { |
197 if (this._scriptMap) | 201 if (this._scriptMap) |
198 return; | 202 return; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 InspectorTest.start = function(description) { | 375 InspectorTest.start = function(description) { |
372 try { | 376 try { |
373 InspectorTest.log(description); | 377 InspectorTest.log(description); |
374 var contextGroup = new InspectorTest.ContextGroup(); | 378 var contextGroup = new InspectorTest.ContextGroup(); |
375 var session = contextGroup.connect(); | 379 var session = contextGroup.connect(); |
376 return { session: session, contextGroup: contextGroup, Protocol: session.Pro
tocol }; | 380 return { session: session, contextGroup: contextGroup, Protocol: session.Pro
tocol }; |
377 } catch (e) { | 381 } catch (e) { |
378 utils.print(e.stack); | 382 utils.print(e.stack); |
379 } | 383 } |
380 } | 384 } |
OLD | NEW |