| 304 | private exited = false; |
| 305 | |
| 306 | constructor(public readonly process: SpawnedProcess) { |
| 307 | this.vmServiceUri = new Promise((resolve) => { |
| 308 | process.stdout.on("data", (data: Buffer | string) => { |
| 309 | const match = vmServiceListeningBannerPattern.exec(data.toString()); |
| 310 | if (match) |
| 311 | resolve(match[1]); |
| 312 | }); |
| 313 | }); |
| 314 | this.exitCode = new Promise<number | null>((resolve) => { |
| 315 | process.on("exit", (code) => { this.exited = true; resolve(code); }); |
| 316 | }); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | export async function killFlutterTester(): Promise<void> { |