Skip to content

Commit 19e0abb

Browse files
authored
chore: support macOS 26 Tahoe (#40136)
1 parent e4664bf commit 19e0abb

5 files changed

Lines changed: 46 additions & 11 deletions

File tree

packages/playwright-core/src/server/registry/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
172172
'mac14-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
173173
'mac15': cftUrl('mac-x64/chrome-mac-x64.zip'),
174174
'mac15-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
175+
'mac26': cftUrl('mac-x64/chrome-mac-x64.zip'),
176+
'mac26-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
175177
'win64': cftUrl('win64/chrome-win64.zip'),
176178
},
177179
'chromium-headless-shell': {
@@ -203,6 +205,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
203205
'mac14-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
204206
'mac15': cftUrl('mac-x64/chrome-headless-shell-mac-x64.zip'),
205207
'mac15-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
208+
'mac26': cftUrl('mac-x64/chrome-headless-shell-mac-x64.zip'),
209+
'mac26-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
206210
'win64': cftUrl('win64/chrome-headless-shell-win64.zip'),
207211
},
208212
'chromium-tip-of-tree': {
@@ -234,6 +238,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
234238
'mac14-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
235239
'mac15': cftUrl('mac-x64/chrome-mac-x64.zip'),
236240
'mac15-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
241+
'mac26': cftUrl('mac-x64/chrome-mac-x64.zip'),
242+
'mac26-arm64': cftUrl('mac-arm64/chrome-mac-arm64.zip'),
237243
'win64': cftUrl('win64/chrome-win64.zip'),
238244
},
239245
'chromium-tip-of-tree-headless-shell': {
@@ -265,6 +271,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
265271
'mac14-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
266272
'mac15': cftUrl('mac-x64/chrome-headless-shell-mac-x64.zip'),
267273
'mac15-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
274+
'mac26': cftUrl('mac-x64/chrome-headless-shell-mac-x64.zip'),
275+
'mac26-arm64': cftUrl('mac-arm64/chrome-headless-shell-mac-arm64.zip'),
268276
'win64': cftUrl('win64/chrome-headless-shell-win64.zip'),
269277
},
270278
'firefox': {
@@ -296,6 +304,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
296304
'mac14-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
297305
'mac15': 'builds/firefox/%s/firefox-mac.zip',
298306
'mac15-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
307+
'mac26': 'builds/firefox/%s/firefox-mac.zip',
308+
'mac26-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
299309
'win64': 'builds/firefox/%s/firefox-win64.zip',
300310
},
301311
'firefox-beta': {
@@ -327,6 +337,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
327337
'mac14-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
328338
'mac15': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
329339
'mac15-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
340+
'mac26': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
341+
'mac26-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
330342
'win64': 'builds/firefox-beta/%s/firefox-beta-win64.zip',
331343
},
332344
'webkit': {
@@ -358,6 +370,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
358370
'mac14-arm64': 'builds/webkit/%s/webkit-mac-14-arm64.zip',
359371
'mac15': 'builds/webkit/%s/webkit-mac-15.zip',
360372
'mac15-arm64': 'builds/webkit/%s/webkit-mac-15-arm64.zip',
373+
'mac26': 'builds/webkit/%s/webkit-mac-15.zip',
374+
'mac26-arm64': 'builds/webkit/%s/webkit-mac-15-arm64.zip',
361375
'win64': 'builds/webkit/%s/webkit-win64.zip',
362376
},
363377
'ffmpeg': {
@@ -389,6 +403,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
389403
'mac14-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
390404
'mac15': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
391405
'mac15-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
406+
'mac26': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
407+
'mac26-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
392408
'win64': 'builds/ffmpeg/%s/ffmpeg-win64.zip',
393409
},
394410
'winldd': {
@@ -420,6 +436,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
420436
'mac14-arm64': undefined,
421437
'mac15': undefined,
422438
'mac15-arm64': undefined,
439+
'mac26': undefined,
440+
'mac26-arm64': undefined,
423441
'win64': 'builds/winldd/%s/winldd-win64.zip',
424442
},
425443
'android': {
@@ -451,6 +469,8 @@ const DOWNLOAD_PATHS: Record<string, DownloadPaths> = {
451469
'mac14-arm64': 'builds/android/%s/android.zip',
452470
'mac15': 'builds/android/%s/android.zip',
453471
'mac15-arm64': 'builds/android/%s/android.zip',
472+
'mac26': 'builds/android/%s/android.zip',
473+
'mac26-arm64': 'builds/android/%s/android.zip',
454474
'win64': 'builds/android/%s/android.zip',
455475
},
456476
};

packages/playwright-core/src/server/webkit/wkPage.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,13 @@ export class WKPage implements PageDelegate {
844844
}
845845

846846
private _toolbarHeight(): number {
847-
if (this._page.browserContext._browser?.options.headful)
848-
return hostPlatform === 'mac10.15' ? 55 : 59;
847+
if (this._page.browserContext._browser?.options.headful) {
848+
if (hostPlatform === 'mac10.15')
849+
return 55;
850+
if (hostPlatform === 'mac26-arm64' || hostPlatform === 'mac26')
851+
return 69;
852+
return 59;
853+
}
849854
return 0;
850855
}
851856

packages/utils/hostPlatform.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export type HostPlatform = 'win64' |
2727
'mac13' | 'mac13-arm64' |
2828
'mac14' | 'mac14-arm64' |
2929
'mac15' | 'mac15-arm64' |
30+
'mac26' | 'mac26-arm64' |
3031
'ubuntu18.04-x64' | 'ubuntu18.04-arm64' |
3132
'ubuntu20.04-x64' | 'ubuntu20.04-arm64' |
3233
'ubuntu22.04-x64' | 'ubuntu22.04-arm64' |
@@ -54,12 +55,17 @@ function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupporte
5455
macVersion = 'mac10.14';
5556
} else if (ver[0] === 19) {
5657
macVersion = 'mac10.15';
58+
} else if (ver[0] < 25) {
59+
// Darwin 20..24 → macOS 11..15 (BigSur..Sequoia).
60+
macVersion = 'mac' + (ver[0] - 9);
61+
// BigSur is the first version that might run on Apple Silicon.
62+
if (os.cpus().some(cpu => cpu.model.includes('Apple')))
63+
macVersion += '-arm64';
5764
} else {
58-
// ver[0] >= 20
59-
const LAST_STABLE_MACOS_MAJOR_VERSION = 15;
65+
// Apple jumped from macOS 15 (Sequoia) to macOS 26 (Tahoe), so Darwin 25 = macOS 26.
6066
// Best-effort support for MacOS beta versions.
61-
macVersion = 'mac' + Math.min(ver[0] - 9, LAST_STABLE_MACOS_MAJOR_VERSION);
62-
// BigSur is the first version that might run on Apple Silicon.
67+
const LAST_STABLE_MACOS_MAJOR_VERSION = 26;
68+
macVersion = 'mac' + Math.min(ver[0] + 1, LAST_STABLE_MACOS_MAJOR_VERSION);
6369
if (os.cpus().some(cpu => cpu.model.includes('Apple')))
6470
macVersion += '-arm64';
6571
}

tests/config/platformFixtures.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ function platform(): 'win32' | 'darwin' | 'linux' {
3838
function macVersion() {
3939
if (process.platform !== 'darwin')
4040
return 0;
41-
return +os.release().split('.')[0] - 9;
41+
const darwinMajor = +os.release().split('.')[0];
42+
// Apple jumped from macOS 15 (Sequoia) to macOS 26 (Tahoe), so Darwin 25 = macOS 26.
43+
if (darwinMajor >= 25)
44+
return darwinMajor + 1;
45+
return darwinMajor - 9;
4246
}
4347

4448
export const platformTest = test.extend<{}, PlatformWorkerFixtures>({

tests/library/tracing.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,12 @@ for (const params of [
458458

459459
// Check all frame sizes.
460460
for (const frame of frames) {
461-
expect(frame.width).toBe(params.width);
462-
expect(frame.height).toBe(params.height);
461+
expect.soft(frame.width).toBe(params.width);
462+
expect.soft(frame.height).toBe(params.height);
463463
const buffer = resources.get('resources/' + frame.sha1);
464464
const image = jpegjs.decode(buffer);
465-
expect(image.width).toBe(previewWidth);
466-
expect(image.height).toBe(previewHeight);
465+
expect.soft(image.width).toBe(previewWidth);
466+
expect.soft(image.height).toBe(previewHeight);
467467
}
468468

469469
const frame = frames[frames.length - 1]; // pick last frame.

0 commit comments

Comments
 (0)