( childProcess: ChildProcessWithoutNullStreams | null )
| 146 | } |
| 147 | |
| 148 | export function stopChildProcess ( childProcess: ChildProcessWithoutNullStreams | null ) { |
| 149 | return new Promise<void>( resolve => { |
| 150 | if ( !childProcess ) { |
| 151 | resolve() |
| 152 | return |
| 153 | } |
| 154 | |
| 155 | if ( childProcess.killed || childProcess.exitCode !== null ) { |
| 156 | resolve() |
| 157 | return |
| 158 | } |
| 159 | |
| 160 | childProcess.once( 'exit', () => resolve() ) |
| 161 | childProcess.kill( 'SIGTERM' ) |
| 162 | |
| 163 | setTimeout( () => { |
| 164 | if ( childProcess.exitCode === null ) { |
| 165 | childProcess.kill( 'SIGKILL' ) |
| 166 | } |
| 167 | }, 5 * 1000 ).unref() |
| 168 | } ) |
| 169 | } |
| 170 | |
| 171 | export async function launchBrowser (): Promise<Browser> { |
| 172 | return chromium.launch({ |
no outgoing calls
no test coverage detected