feat: browsers: recognize chromium as a valid browser (#9760)
This commit is contained in:
parent
677760456d
commit
04247a4e00
@ -20,11 +20,13 @@ import {Browser, BrowserPlatform, BrowserTag} from './types.js';
|
||||
|
||||
export const downloadUrls = {
|
||||
[Browser.CHROME]: chrome.resolveDownloadUrl,
|
||||
[Browser.CHROMIUM]: chrome.resolveDownloadUrl,
|
||||
[Browser.FIREFOX]: firefox.resolveDownloadUrl,
|
||||
};
|
||||
|
||||
export const executablePathByBrowser = {
|
||||
[Browser.CHROME]: chrome.relativeExecutablePath,
|
||||
[Browser.CHROMIUM]: chrome.relativeExecutablePath,
|
||||
[Browser.FIREFOX]: firefox.relativeExecutablePath,
|
||||
};
|
||||
|
||||
@ -42,6 +44,7 @@ export async function resolveBuildId(
|
||||
return await firefox.resolveBuildId('FIREFOX_NIGHTLY');
|
||||
}
|
||||
case Browser.CHROME:
|
||||
case Browser.CHROMIUM:
|
||||
switch (tag as BrowserTag) {
|
||||
case BrowserTag.LATEST:
|
||||
return await chrome.resolveBuildId(platform, 'latest');
|
||||
|
@ -22,6 +22,7 @@ import * as firefox from './firefox.js';
|
||||
*/
|
||||
export enum Browser {
|
||||
CHROME = 'chrome',
|
||||
CHROMIUM = 'chromium',
|
||||
FIREFOX = 'firefox',
|
||||
}
|
||||
|
||||
@ -39,6 +40,7 @@ export enum BrowserPlatform {
|
||||
|
||||
export const downloadUrls = {
|
||||
[Browser.CHROME]: chrome.resolveDownloadUrl,
|
||||
[Browser.CHROMIUM]: chrome.resolveDownloadUrl,
|
||||
[Browser.FIREFOX]: firefox.resolveDownloadUrl,
|
||||
};
|
||||
|
||||
|
@ -38,6 +38,18 @@ describe('launcher', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('should compute executable path for Chromium', () => {
|
||||
assert.strictEqual(
|
||||
computeExecutablePath({
|
||||
browser: Browser.CHROMIUM,
|
||||
platform: BrowserPlatform.LINUX,
|
||||
buildId: '123',
|
||||
cacheDir: 'cache',
|
||||
}),
|
||||
path.join('cache', 'chromium', 'linux-123', 'chrome-linux', 'chrome')
|
||||
);
|
||||
});
|
||||
|
||||
it('should compute executable path for Firefox', () => {
|
||||
assert.strictEqual(
|
||||
computeExecutablePath({
|
||||
|
Loading…
Reference in New Issue
Block a user