This commit is contained in:
Yury Semikhatsky 2024-08-13 11:54:51 -07:00
parent e9014f2b6e
commit 05b644c4fe
2 changed files with 3 additions and 3 deletions

View file

@ -359,7 +359,7 @@ export class Chromium extends BrowserType {
}
class ChromiumReadyState implements BrowserReadyState {
private readonly _wsEndpoint = new ManualPromise<string>();
private readonly _wsEndpoint = new ManualPromise<string|undefined>();
onBrowserOutput(message: string): void {
const match = message.match(/DevTools listening on (.*)/);
@ -367,7 +367,7 @@ class ChromiumReadyState implements BrowserReadyState {
this._wsEndpoint.resolve(match[1]);
}
onBrowserExit(): void {
this._wsEndpoint.reject(new Error('Browser exited'));
this._wsEndpoint.resolve(undefined);
}
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
const wsEndpoint = await this._wsEndpoint;

View file

@ -104,7 +104,7 @@ class JugglerReadyState implements BrowserReadyState {
}
onBrowserExit(): void {
// Unblock launch when browser prematurely exits.
this._jugglerPromise.reject(new Error('Browser exited'));
this._jugglerPromise.resolve();
}
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
await this._jugglerPromise;