@@ -55,7 +55,7 @@ const ENV_DOWNLOAD_HOSTS: { [key: string]: string } = {
55
55
webkit : 'PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST' ,
56
56
} ;
57
57
58
- function getDownloadUrl ( browserName : BrowserName , platform : BrowserPlatform ) : string | undefined {
58
+ function getDownloadUrl ( browserName : BrowserName , revision : number , platform : BrowserPlatform ) : string | undefined {
59
59
if ( browserName === 'chromium' ) {
60
60
return new Map < BrowserPlatform , string > ( [
61
61
[ 'linux' , '%s/chromium-browser-snapshots/Linux_x64/%d/chrome-linux.zip' ] ,
@@ -68,31 +68,51 @@ function getDownloadUrl(browserName: BrowserName, platform: BrowserPlatform): st
68
68
}
69
69
70
70
if ( browserName === 'firefox' ) {
71
- return new Map < BrowserPlatform , string > ( [
72
- [ 'linux' , '%s/builds/firefox/%s/firefox-linux.zip' ] ,
73
- [ 'mac10.13' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
74
- [ 'mac10.14' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
75
- [ 'mac10.15' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
76
- [ 'win32' , '%s/builds/firefox/%s/firefox-win32.zip' ] ,
77
- [ 'win64' , '%s/builds/firefox/%s/firefox-win64.zip' ] ,
78
- ] ) . get ( platform ) ;
71
+ const FIREFOX_RENAME_LINUX_TO_UBUNTU_REVISION = 1139 ;
72
+ return revision < FIREFOX_RENAME_LINUX_TO_UBUNTU_REVISION ?
73
+ new Map < BrowserPlatform , string > ( [
74
+ [ 'linux' , '%s/builds/firefox/%s/firefox-linux.zip' ] ,
75
+ [ 'mac10.13' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
76
+ [ 'mac10.14' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
77
+ [ 'mac10.15' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
78
+ [ 'win32' , '%s/builds/firefox/%s/firefox-win32.zip' ] ,
79
+ [ 'win64' , '%s/builds/firefox/%s/firefox-win64.zip' ] ,
80
+ ] ) . get ( platform ) :
81
+ new Map < BrowserPlatform , string > ( [
82
+ [ 'linux' , '%s/builds/firefox/%s/firefox-ubuntu-18.04.zip' ] ,
83
+ [ 'mac10.13' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
84
+ [ 'mac10.14' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
85
+ [ 'mac10.15' , '%s/builds/firefox/%s/firefox-mac.zip' ] ,
86
+ [ 'win32' , '%s/builds/firefox/%s/firefox-win32.zip' ] ,
87
+ [ 'win64' , '%s/builds/firefox/%s/firefox-win64.zip' ] ,
88
+ ] ) . get ( platform ) ;
79
89
}
80
90
81
91
if ( browserName === 'webkit' ) {
82
- return new Map < BrowserPlatform , string | undefined > ( [
83
- [ 'linux' , '%s/builds/webkit/%s/minibrowser-gtk-wpe.zip' ] ,
84
- [ 'mac10.13' , undefined ] ,
85
- [ 'mac10.14' , '%s/builds/webkit/%s/minibrowser-mac-10.14.zip' ] ,
86
- [ 'mac10.15' , '%s/builds/webkit/%s/minibrowser-mac-10.15.zip' ] ,
87
- [ 'win32' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
88
- [ 'win64' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
89
- ] ) . get ( platform ) ;
92
+ const WEBKIT_RENAME_LINUX_TO_UBUNTU_REVISION = 1315 ;
93
+ return revision < WEBKIT_RENAME_LINUX_TO_UBUNTU_REVISION ?
94
+ new Map < BrowserPlatform , string | undefined > ( [
95
+ [ 'linux' , '%s/builds/webkit/%s/minibrowser-gtk-wpe.zip' ] ,
96
+ [ 'mac10.13' , undefined ] ,
97
+ [ 'mac10.14' , '%s/builds/webkit/%s/minibrowser-mac-10.14.zip' ] ,
98
+ [ 'mac10.15' , '%s/builds/webkit/%s/minibrowser-mac-10.15.zip' ] ,
99
+ [ 'win32' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
100
+ [ 'win64' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
101
+ ] ) . get ( platform ) :
102
+ new Map < BrowserPlatform , string | undefined > ( [
103
+ [ 'linux' , '%s/builds/webkit/%s/minibrowser-gtk-wpe-ubuntu-18.04.zip' ] ,
104
+ [ 'mac10.13' , undefined ] ,
105
+ [ 'mac10.14' , '%s/builds/webkit/%s/minibrowser-mac-10.14.zip' ] ,
106
+ [ 'mac10.15' , '%s/builds/webkit/%s/minibrowser-mac-10.15.zip' ] ,
107
+ [ 'win32' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
108
+ [ 'win64' , '%s/builds/webkit/%s/minibrowser-win64.zip' ] ,
109
+ ] ) . get ( platform ) ;
90
110
}
91
111
}
92
112
93
113
function revisionURL ( browser : BrowserDescriptor , platform = browserPaths . hostPlatform ) : string {
94
114
const serverHost = getFromENV ( ENV_DOWNLOAD_HOSTS [ browser . name ] ) || getFromENV ( ENV_DOWNLOAD_HOSTS . default ) || DEFAULT_DOWNLOAD_HOSTS [ browser . name ] ;
95
- const urlTemplate = getDownloadUrl ( browser . name , platform ) ;
115
+ const urlTemplate = getDownloadUrl ( browser . name , parseInt ( browser . revision , 10 ) , platform ) ;
96
116
assert ( urlTemplate , `ERROR: Playwright does not support ${ browser . name } on ${ platform } ` ) ;
97
117
return util . format ( urlTemplate , serverHost , browser . revision ) ;
98
118
}
0 commit comments