| 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._dispatchTable = new Map(); | 6 InspectorTest._dispatchTable = new Map(); |
| 7 InspectorTest._requestId = 0; | 7 InspectorTest._requestId = 0; |
| 8 InspectorTest._dumpInspectorProtocolMessages = false; | 8 InspectorTest._dumpInspectorProtocolMessages = false; |
| 9 InspectorTest._eventHandler = {}; | 9 InspectorTest._eventHandler = {}; |
| 10 InspectorTest._commandsForLogging = new Set(); | 10 InspectorTest._commandsForLogging = new Set(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 else | 26 else |
| 27 return (listener) => { InspectorTest._eventHandler[`${agentName}.${e
ventName}`] = listener }; | 27 return (listener) => { InspectorTest._eventHandler[`${agentName}.${e
ventName}`] = listener }; |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 }); | 30 }); |
| 31 } | 31 } |
| 32 }); | 32 }); |
| 33 | 33 |
| 34 InspectorTest.logProtocolCommandCalls = (command) => InspectorTest._commandsForL
ogging.add(command); | 34 InspectorTest.logProtocolCommandCalls = (command) => InspectorTest._commandsForL
ogging.add(command); |
| 35 | 35 |
| 36 var utils = {}; | |
| 37 (function setupUtils() { | |
| 38 utils.load = load; | |
| 39 this.load = null; | |
| 40 utils.read = read; | |
| 41 this.read = null; | |
| 42 utils.compileAndRunWithOrigin = compileAndRunWithOrigin; | |
| 43 this.compileAndRunWithOrigin = null; | |
| 44 utils.quit = quit; | |
| 45 this.quit = null; | |
| 46 utils.print = print; | |
| 47 this.print = null; | |
| 48 utils.setlocale = setlocale; | |
| 49 this.setlocale = null; | |
| 50 utils.setCurrentTimeMSForTest = setCurrentTimeMSForTest; | |
| 51 this.setCurrentTimeMSForTest = null; | |
| 52 utils.setMemoryInfoForTest = setMemoryInfoForTest; | |
| 53 this.setMemoryInfoForTest = null; | |
| 54 utils.schedulePauseOnNextStatement = schedulePauseOnNextStatement; | |
| 55 this.schedulePauseOnNextStatement = null; | |
| 56 utils.cancelPauseOnNextStatement = cancelPauseOnNextStatement; | |
| 57 this.cancelPauseOnNextStatement = null; | |
| 58 utils.reconnect = reconnect; | |
| 59 this.reconnect = null; | |
| 60 utils.setLogConsoleApiMessageCalls = setLogConsoleApiMessageCalls; | |
| 61 this.setLogConsoleApiMessageCalls = null; | |
| 62 utils.createContextGroup = createContextGroup; | |
| 63 this.createContextGroup = null; | |
| 64 })(); | |
| 65 | |
| 66 InspectorTest.log = utils.print.bind(null); | 36 InspectorTest.log = utils.print.bind(null); |
| 67 | 37 |
| 68 InspectorTest.logMessage = function(originalMessage) | 38 InspectorTest.logMessage = function(originalMessage) |
| 69 { | 39 { |
| 70 var message = JSON.parse(JSON.stringify(originalMessage)); | 40 var message = JSON.parse(JSON.stringify(originalMessage)); |
| 71 if (message.id) | 41 if (message.id) |
| 72 message.id = "<messageId>"; | 42 message.id = "<messageId>"; |
| 73 | 43 |
| 74 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", | 44 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", |
| 75 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti
onId", "formatterObjectId" ]); | 45 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti
onId", "formatterObjectId" ]); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to
get more details.'); | 321 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to
get more details.'); |
| 352 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to
get unminified injected-script-source.js.'); | 322 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to
get unminified injected-script-source.js.'); |
| 353 InspectorTest.setupScriptMap(); | 323 InspectorTest.setupScriptMap(); |
| 354 Protocol.Debugger.enable(); | 324 Protocol.Debugger.enable(); |
| 355 Protocol.Debugger.onPaused(message => { | 325 Protocol.Debugger.onPaused(message => { |
| 356 let callFrames = message.params.callFrames; | 326 let callFrames = message.params.callFrames; |
| 357 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location)); | 327 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location)); |
| 358 }) | 328 }) |
| 359 } | 329 } |
| 360 } | 330 } |
| OLD | NEW |