()
| 975 | } |
| 976 | |
| 977 | async run() { |
| 978 | try { |
| 979 | const { childArgv, host, port, skipPortPreflight } = this.options; |
| 980 | const { 0: child, 1: actualPort, 2: actualHost } = |
| 981 | await launchChildProcess(childArgv, |
| 982 | host, |
| 983 | port, |
| 984 | this.onChildOutput, |
| 985 | { skipPortPreflight }); |
| 986 | this.child = child; |
| 987 | // On Debugger.enable, V8 emits Debugger.scriptParsed for all existing scripts. |
| 988 | // Attach the listener early to make sure we don't miss any events. |
| 989 | this.attachListeners(); |
| 990 | |
| 991 | await this.client.connect(actualPort, actualHost); |
| 992 | this.connected = true; |
| 993 | |
| 994 | try { |
| 995 | await this.callCdp('Runtime.enable'); |
| 996 | await this.callCdp('Debugger.enable'); |
| 997 | await this.bindBreakpoints(); |
| 998 | this.started = true; |
| 999 | this.startTimeout(); |
| 1000 | await this.callCdp('Runtime.runIfWaitingForDebugger'); |
| 1001 | } catch (err) { |
| 1002 | if (err !== kInspectorFailedSentinel) { throw err; } |
| 1003 | } |
| 1004 | |
| 1005 | const state = await this.completionPromise; |
| 1006 | return this.buildReport(state); |
| 1007 | } finally { |
| 1008 | await this.cleanup(); |
| 1009 | } |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | async function runProbeMode(stdout, probeOptions) { |
no test coverage detected