chore: tidy up headless-shell hacks (#33967)
This commit is contained in:
Родитель
a4add6ebaf
Коммит
38758c0596
|
@ -7,24 +7,12 @@
|
|||
"installByDefault": true,
|
||||
"browserVersion": "132.0.6834.46"
|
||||
},
|
||||
{
|
||||
"name": "chromium-headless-shell",
|
||||
"revision": "1152",
|
||||
"installByDefault": true,
|
||||
"browserVersion": "132.0.6834.46"
|
||||
},
|
||||
{
|
||||
"name": "chromium-tip-of-tree",
|
||||
"revision": "1285",
|
||||
"installByDefault": false,
|
||||
"browserVersion": "133.0.6887.0"
|
||||
},
|
||||
{
|
||||
"name": "chromium-tip-of-tree-headless-shell",
|
||||
"revision": "1285",
|
||||
"installByDefault": false,
|
||||
"browserVersion": "133.0.6887.0"
|
||||
},
|
||||
{
|
||||
"name": "firefox",
|
||||
"revision": "1466",
|
||||
|
|
|
@ -415,7 +415,14 @@ type BrowsersJSONDescriptor = {
|
|||
};
|
||||
|
||||
function readDescriptors(browsersJSON: BrowsersJSON): BrowsersJSONDescriptor[] {
|
||||
return (browsersJSON['browsers']).map(obj => {
|
||||
const headlessShells: BrowsersJSON['browsers'] = [];
|
||||
for (const browserName of ['chromium', 'chromium-tip-of-tree']) {
|
||||
headlessShells.push({
|
||||
...browsersJSON.browsers.find(browser => browser.name === browserName)!,
|
||||
name: `${browserName}-headless-shell`,
|
||||
});
|
||||
}
|
||||
return [...browsersJSON.browsers, ...headlessShells].map(obj => {
|
||||
const name = obj.name;
|
||||
const revisionOverride = (obj.revisionOverrides || {})[hostPlatform];
|
||||
const revision = revisionOverride || obj.revision;
|
||||
|
|
|
@ -94,18 +94,6 @@ Example:
|
|||
console.log('\nUpdating browser version in browsers.json...');
|
||||
for (const descriptor of descriptors)
|
||||
descriptor.browserVersion = browserVersion;
|
||||
|
||||
// 4.1 chromium-headless-shell is equal to chromium version.
|
||||
if (browserName === 'chromium') {
|
||||
const headlessShellBrowser = await browsersJSON.browsers.find(b => b.name === 'chromium-headless-shell');
|
||||
headlessShellBrowser.revision = revision;
|
||||
headlessShellBrowser.browserVersion = browserVersion;
|
||||
} else if (browserName === 'chromium-tip-of-tree') {
|
||||
const tipOfTreeBrowser = await browsersJSON.browsers.find(b => b.name === 'chromium-tip-of-tree-headless-shell');
|
||||
tipOfTreeBrowser.revision = revision;
|
||||
tipOfTreeBrowser.browserVersion = browserVersion;
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.join(CORE_PATH, 'browsers.json'), JSON.stringify(browsersJSON, null, 2) + '\n');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче