cherrypick(release-1.4): throw unexpected platform error upon call (#3946)
Cherry-pick: - PR #3943 SHA 0090cd943c8c724cb0fe8b02f4fd7f7e7ba837bd References #3919 and #3935 Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
This commit is contained in:
parent
e79eada2be
commit
b05c098f2a
|
|
@ -54,6 +54,8 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel, chann
|
||||||
}
|
}
|
||||||
|
|
||||||
executablePath(): string {
|
executablePath(): string {
|
||||||
|
if (!this._initializer.executablePath)
|
||||||
|
throw new Error('Browser is not supported on current platform');
|
||||||
return this._initializer.executablePath;
|
return this._initializer.executablePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ type WebSocketNotPipe = { webSocketRegex: RegExp, stream: 'stdout' | 'stderr' };
|
||||||
|
|
||||||
export abstract class BrowserTypeBase implements BrowserType {
|
export abstract class BrowserTypeBase implements BrowserType {
|
||||||
private _name: string;
|
private _name: string;
|
||||||
private _executablePath: string | undefined;
|
private _executablePath: string;
|
||||||
private _webSocketNotPipe: WebSocketNotPipe | null;
|
private _webSocketNotPipe: WebSocketNotPipe | null;
|
||||||
private _browserDescriptor: browserPaths.BrowserDescriptor;
|
private _browserDescriptor: browserPaths.BrowserDescriptor;
|
||||||
readonly _browserPath: string;
|
readonly _browserPath: string;
|
||||||
|
|
@ -57,13 +57,11 @@ export abstract class BrowserTypeBase implements BrowserType {
|
||||||
const browsersPath = browserPaths.browsersPath(packagePath);
|
const browsersPath = browserPaths.browsersPath(packagePath);
|
||||||
this._browserDescriptor = browser;
|
this._browserDescriptor = browser;
|
||||||
this._browserPath = browserPaths.browserDirectory(browsersPath, browser);
|
this._browserPath = browserPaths.browserDirectory(browsersPath, browser);
|
||||||
this._executablePath = browserPaths.executablePath(this._browserPath, browser);
|
this._executablePath = browserPaths.executablePath(this._browserPath, browser) || '';
|
||||||
this._webSocketNotPipe = webSocketOrPipe;
|
this._webSocketNotPipe = webSocketOrPipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
executablePath(): string {
|
executablePath(): string {
|
||||||
if (!this._executablePath)
|
|
||||||
throw new Error('Browser is not supported on current platform');
|
|
||||||
return this._executablePath;
|
return this._executablePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue