mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
fix(executablePath): throw unexpected platform error upon call (#3943)
This commit is contained in:
parent
cd0a123e78
commit
f1016c1fc1
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ type WebSocketNotPipe = { webSocketRegex: RegExp, stream: 'stdout' | 'stderr' };
|
|||||||
|
|
||||||
export abstract class BrowserType {
|
export abstract class 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;
|
||||||
@ -49,13 +49,11 @@ export abstract class 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 New Issue
Block a user