@@ -40,20 +40,23 @@ const DEFAULT_DOWNLOAD_HOSTS = {
40
40
const DOWNLOAD_URLS = {
41
41
chromium : {
42
42
'linux' : '%s/chromium-browser-snapshots/Linux_x64/%d/chrome-linux.zip' ,
43
+ 'mac10.13' : '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip' ,
43
44
'mac10.14' : '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip' ,
44
45
'mac10.15' : '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip' ,
45
46
'win32' : '%s/chromium-browser-snapshots/Win/%d/chrome-win.zip' ,
46
47
'win64' : '%s/chromium-browser-snapshots/Win_x64/%d/chrome-win.zip' ,
47
48
} ,
48
49
firefox : {
49
50
'linux' : '%s/builds/firefox/%s/firefox-linux.zip' ,
51
+ 'mac10.13' : '%s/builds/firefox/%s/firefox-mac.zip' ,
50
52
'mac10.14' : '%s/builds/firefox/%s/firefox-mac.zip' ,
51
53
'mac10.15' : '%s/builds/firefox/%s/firefox-mac.zip' ,
52
54
'win32' : '%s/builds/firefox/%s/firefox-win32.zip' ,
53
55
'win64' : '%s/builds/firefox/%s/firefox-win64.zip' ,
54
56
} ,
55
57
webkit : {
56
58
'linux' : '%s/builds/webkit/%s/minibrowser-gtk-wpe.zip' ,
59
+ 'mac10.13' : undefined ,
57
60
'mac10.14' : '%s/builds/webkit/%s/minibrowser-mac-10.14.zip' ,
58
61
'mac10.15' : '%s/builds/webkit/%s/minibrowser-mac-10.15.zip' ,
59
62
'win32' : '%s/builds/webkit/%s/minibrowser-win64.zip' ,
@@ -64,20 +67,23 @@ const DOWNLOAD_URLS = {
64
67
const RELATIVE_EXECUTABLE_PATHS = {
65
68
chromium : {
66
69
'linux' : [ 'chrome-linux' , 'chrome' ] ,
70
+ 'mac10.13' : [ 'chrome-mac' , 'Chromium.app' , 'Contents' , 'MacOS' , 'Chromium' ] ,
67
71
'mac10.14' : [ 'chrome-mac' , 'Chromium.app' , 'Contents' , 'MacOS' , 'Chromium' ] ,
68
72
'mac10.15' : [ 'chrome-mac' , 'Chromium.app' , 'Contents' , 'MacOS' , 'Chromium' ] ,
69
73
'win32' : [ 'chrome-win' , 'chrome.exe' ] ,
70
74
'win64' : [ 'chrome-win' , 'chrome.exe' ] ,
71
75
} ,
72
76
firefox : {
73
77
'linux' : [ 'firefox' , 'firefox' ] ,
78
+ 'mac10.13' : [ 'firefox' , 'Nightly.app' , 'Contents' , 'MacOS' , 'firefox' ] ,
74
79
'mac10.14' : [ 'firefox' , 'Nightly.app' , 'Contents' , 'MacOS' , 'firefox' ] ,
75
80
'mac10.15' : [ 'firefox' , 'Nightly.app' , 'Contents' , 'MacOS' , 'firefox' ] ,
76
81
'win32' : [ 'firefox' , 'firefox.exe' ] ,
77
82
'win64' : [ 'firefox' , 'firefox.exe' ] ,
78
83
} ,
79
84
webkit : {
80
85
'linux' : [ 'pw_run.sh' ] ,
86
+ 'mac10.13' : undefined ,
81
87
'mac10.14' : [ 'pw_run.sh' ] ,
82
88
'mac10.15' : [ 'pw_run.sh' ] ,
83
89
'win32' : [ 'MiniBrowser.exe' ] ,
@@ -87,7 +93,7 @@ const RELATIVE_EXECUTABLE_PATHS = {
87
93
88
94
export type OnProgressCallback = ( downloadedBytes : number , totalBytes : number ) => void ;
89
95
export type BrowserName = ( 'chromium' | 'webkit' | 'firefox' ) ;
90
- export type BrowserPlatform = ( 'win32' | 'win64' | 'mac10.14' | 'mac10.15' | 'linux' ) ;
96
+ export type BrowserPlatform = ( 'win32' | 'win64' | 'mac10.13' | 'mac10. 14'| 'mac10.15' | 'linux' ) ;
91
97
92
98
export type DownloadOptions = {
93
99
browser : BrowserName ,
@@ -120,7 +126,7 @@ function revisionURL(options: DownloadOptions): string {
120
126
} = options ;
121
127
assert ( revision , `'revision' must be specified` ) ;
122
128
assert ( DOWNLOAD_URLS [ browser ] , 'Unsupported browser: ' + browser ) ;
123
- const urlTemplate = ( DOWNLOAD_URLS [ browser ] as any ) [ platform ] ;
129
+ const urlTemplate = DOWNLOAD_URLS [ browser ] [ platform as BrowserPlatform ] ;
124
130
assert ( urlTemplate , `ERROR: Playwright does not support ${ browser } on ${ platform } ` ) ;
125
131
return util . format ( urlTemplate , host , revision ) ;
126
132
}
@@ -155,7 +161,9 @@ export function executablePath(options: DownloadOptions): string {
155
161
downloadPath,
156
162
platform = CURRENT_HOST_PLATFORM ,
157
163
} = options ;
158
- return path . join ( downloadPath , ...RELATIVE_EXECUTABLE_PATHS [ browser ] [ platform as BrowserPlatform ] ) ;
164
+ const relativePath = RELATIVE_EXECUTABLE_PATHS [ browser ] [ platform as BrowserPlatform ] ;
165
+ assert ( relativePath , `Unsupported platform for ${ browser } : ${ platform } ` ) ;
166
+ return path . join ( downloadPath , ...relativePath ) ;
159
167
}
160
168
161
169
export async function canDownload ( options : DownloadOptions ) : Promise < boolean > {
0 commit comments