test: update cookie expectations for macOS 15 (#32674)

This commit is contained in:
Max Schmitt 2024-09-18 11:08:17 +02:00 committed by GitHub
parent 4460c98710
commit 9fc195bff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -69,12 +69,16 @@ const test = baseTest.extend<BrowserTestTestFixtures, BrowserTestWorkerFixtures>
await run(false);
}, { scope: 'worker' }],
defaultSameSiteCookieValue: [async ({ browserName, isLinux }, run) => {
defaultSameSiteCookieValue: [async ({ browserName, platform }, run) => {
if (browserName === 'chromium' || browserName as any === '_bidiChromium')
await run('Lax');
else if (browserName === 'webkit' && isLinux)
else if (browserName === 'webkit' && platform === 'linux')
await run('Lax');
else if (browserName === 'webkit' && !isLinux)
else if (browserName === 'webkit' && platform === 'darwin' && parseInt(os.release(), 10) >= 24)
// macOS 15 Sequoia onwards
await run('Lax');
else if (browserName === 'webkit')
// Windows + older macOS
await run('None');
else if (browserName === 'firefox' || browserName as any === '_bidiFirefox')
await run('None');

View file

@ -15,6 +15,7 @@
* limitations under the License.
*/
import os from 'os';
import { contextTest as it, expect } from '../config/browserTest';
it('should return no cookies in pristine browser context', async ({ context, page, server }) => {
@ -396,7 +397,7 @@ it('should support requestStorageAccess', async ({ page, server, channel, browse
server.waitForRequest('/title.html'),
frame.evaluate(() => fetch('/title.html'))
]);
if (isLinux && browserName === 'webkit')
if ((isLinux || (isMac && parseInt(os.release(), 10) >= 24)) && browserName === 'webkit')
expect(serverRequest.headers.cookie).toBe(undefined);
else
expect(serverRequest.headers.cookie).toBe('name=value');