--amend
This commit is contained in:
parent
e9014f2b6e
commit
05b644c4fe
|
|
@ -359,7 +359,7 @@ export class Chromium extends BrowserType {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChromiumReadyState implements BrowserReadyState {
|
class ChromiumReadyState implements BrowserReadyState {
|
||||||
private readonly _wsEndpoint = new ManualPromise<string>();
|
private readonly _wsEndpoint = new ManualPromise<string|undefined>();
|
||||||
|
|
||||||
onBrowserOutput(message: string): void {
|
onBrowserOutput(message: string): void {
|
||||||
const match = message.match(/DevTools listening on (.*)/);
|
const match = message.match(/DevTools listening on (.*)/);
|
||||||
|
|
@ -367,7 +367,7 @@ class ChromiumReadyState implements BrowserReadyState {
|
||||||
this._wsEndpoint.resolve(match[1]);
|
this._wsEndpoint.resolve(match[1]);
|
||||||
}
|
}
|
||||||
onBrowserExit(): void {
|
onBrowserExit(): void {
|
||||||
this._wsEndpoint.reject(new Error('Browser exited'));
|
this._wsEndpoint.resolve(undefined);
|
||||||
}
|
}
|
||||||
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
|
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
|
||||||
const wsEndpoint = await this._wsEndpoint;
|
const wsEndpoint = await this._wsEndpoint;
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ class JugglerReadyState implements BrowserReadyState {
|
||||||
}
|
}
|
||||||
onBrowserExit(): void {
|
onBrowserExit(): void {
|
||||||
// Unblock launch when browser prematurely exits.
|
// Unblock launch when browser prematurely exits.
|
||||||
this._jugglerPromise.reject(new Error('Browser exited'));
|
this._jugglerPromise.resolve();
|
||||||
}
|
}
|
||||||
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
|
async waitUntilReady(): Promise<{ wsEndpoint?: string }> {
|
||||||
await this._jugglerPromise;
|
await this._jugglerPromise;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue