Skip to content

Commit

Permalink
devops: start downloading webkit fork on Mac 10.14 (#5837)
Browse files Browse the repository at this point in the history
References #5833
  • Loading branch information
aslushnikov authored Mar 17, 2021
1 parent 693e569 commit ae460f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
{
"name": "webkit",
"revision": "1446",
"download": true
"download": true,
"revisionOverrides": {
"mac10.14": "1443"
}
},
{
"name": "ffmpeg",
Expand Down
18 changes: 15 additions & 3 deletions src/utils/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type BrowserDescriptor = {
name: BrowserName,
revision: string,
download: boolean,
browserDirectory: string,
};

const EXECUTABLE_PATHS = {
Expand Down Expand Up @@ -107,7 +108,7 @@ const DOWNLOAD_URLS = {
'ubuntu18.04': '%s/builds/webkit/%s/webkit-ubuntu-18.04.zip',
'ubuntu20.04': '%s/builds/webkit/%s/webkit-ubuntu-20.04.zip',
'mac10.13': undefined,
'mac10.14': '%s/builds/webkit/%s/webkit-mac-10.14.zip',
'mac10.14': '%s/builds/deprecated-webkit-mac-10.14/%s/deprecated-webkit-mac-10.14.zip',
'mac10.15': '%s/builds/webkit/%s/webkit-mac-10.15.zip',
'mac11': '%s/builds/webkit/%s/webkit-mac-10.15.zip',
'mac11-arm64': '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip',
Expand Down Expand Up @@ -203,13 +204,24 @@ export class Registry {

constructor(packagePath: string) {
const browsersJSON = JSON.parse(fs.readFileSync(path.join(packagePath, 'browsers.json'), 'utf8'));
this._descriptors = browsersJSON['browsers'];
this._descriptors = browsersJSON['browsers'].map((obj: any) => {
const name = obj.name;
const revisionOverride = (obj.revisionOverrides || {})[hostPlatform];
const revision = revisionOverride || obj.revision;
const browserDirectory = revisionOverride ? `${name}-${hostPlatform}-special-${revision}` : `${name}-${revision}`;
return {
name,
revision,
download: obj.download,
browserDirectory,
};
});
}

browserDirectory(browserName: BrowserName): string {
const browser = this._descriptors.find(browser => browser.name === browserName);
assert(browser, `ERROR: Playwright does not support ${browserName}`);
return path.join(registryDirectory, `${browser.name}-${browser.revision}`);
return path.join(registryDirectory, browser.browserDirectory);
}

revision(browserName: BrowserName): number {
Expand Down

0 comments on commit ae460f0

Please sign in to comment.