chore: remove macOS <=12 checks (#33591)

This commit is contained in:
Yury Semikhatsky 2024-11-13 17:21:21 -08:00 committed by GitHub
parent 5203c780ae
commit a8af7cc435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 13 additions and 29 deletions

View File

@ -16,7 +16,6 @@
*/
import path from 'path';
import os from 'os';
import { PNG, jpegjs } from '../../utilsBundle';
import { splitErrorMessage } from '../../utils/stackTrace';
import { assert, createGuid, debugAssert, headersArrayToObject } from '../../utils';
@ -715,12 +714,7 @@ export class WKPage implements PageDelegate {
];
if (options.isMobile) {
const angle = viewportSize.width > viewportSize.height ? 90 : 0;
// Special handling for macOS 12.
const useLegacySetOrientationOverrideMethod = os.platform() === 'darwin' && parseInt(os.release().split('.')[0], 10) <= 21;
if (useLegacySetOrientationOverrideMethod)
promises.push(this._session.send('Page.setOrientationOverride' as any, { angle }));
else
promises.push(this._pageProxySession.send('Emulation.setOrientationOverride', { angle }));
promises.push(this._pageProxySession.send('Emulation.setOrientationOverride', { angle }));
}
await Promise.all(promises);
}

View File

@ -177,10 +177,9 @@ browserTest('should be able to get correct orientation angle on non-mobile devic
await context.close();
});
it('should set window.screen.orientation.type for mobile devices', async ({ contextFactory, browserName, server, isMac, macVersion }) => {
it('should set window.screen.orientation.type for mobile devices', async ({ contextFactory, browserName, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31151' });
it.skip(browserName === 'firefox', 'Firefox does not support mobile emulation');
it.skip(browserName === 'webkit' && isMac && macVersion <= 12, 'WebKit on macOS 12 is frozen and does not support orientation.type override');
const context = await contextFactory(devices['iPhone 14']);
const page = await context.newPage();
await page.goto(server.PREFIX + '/index.html');

View File

@ -680,9 +680,8 @@ for (const kind of ['launchServer', 'run-server'] as const) {
expect(await response.json()).toEqual({ 'foo': 'bar' });
});
test('should upload large file', async ({ connect, startRemoteServer, server, browserName, isMac, macVersion, mode }, testInfo) => {
test('should upload large file', async ({ connect, startRemoteServer, server, mode }, testInfo) => {
test.skip(mode.startsWith('service'), 'Take it easy on service');
test.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');
test.slow();
const remoteServer = await startRemoteServer(kind);
const browser = await connect(remoteServer.wsEndpoint());

View File

@ -19,8 +19,7 @@ import url from 'url';
import { contextTest as it, expect } from '../config/browserTest';
import { hostPlatform } from '../../packages/playwright-core/src/utils/hostPlatform';
it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer, isMac, macVersion, browserName }) {
it.skip(browserName === 'webkit' && isMac && macVersion <= 12, 'WebKit on macOS 12 is frozen and does not support SharedArrayBuffer');
it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer }) {
const context = await contextFactory({ ignoreHTTPSErrors: true });
const page = await context.newPage();
httpsServer.setRoute('/sharedarraybuffer', (req, res) => {
@ -234,9 +233,8 @@ it('make sure that XMLHttpRequest upload events are emitted correctly', async ({
expect(events).toEqual(['loadstart', 'progress', 'load', 'loadend']);
});
it('loading in HTMLImageElement.prototype', async ({ page, server, browserName, isMac, macVersion }) => {
it('loading in HTMLImageElement.prototype', async ({ page, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22738' });
it.skip(browserName === 'webkit' && isMac && macVersion < 12, 'macOS 11 is frozen');
await page.goto(server.EMPTY_PAGE);
const defined = await page.evaluate(() => 'loading' in HTMLImageElement.prototype);
expect(defined).toBeTruthy();
@ -251,7 +249,7 @@ it('window.GestureEvent in WebKit', async ({ page, server, browserName }) => {
expect(type).toBe(browserName === 'webkit' ? 'function' : 'undefined');
});
it('requestFullscreen', async ({ page, server, browserName, headless, isLinux }) => {
it('requestFullscreen', async ({ page, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22832' });
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
@ -268,7 +266,7 @@ it('requestFullscreen', async ({ page, server, browserName, headless, isLinux })
expect(await page.evaluate(() => !!document.fullscreenElement)).toBeFalsy();
});
it('should send no Content-Length header for GET requests with a Content-Type', async ({ page, server, browserName }) => {
it('should send no Content-Length header for GET requests with a Content-Type', async ({ page, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22569' });
await page.goto(server.EMPTY_PAGE);
const [request] = await Promise.all([

View File

@ -42,9 +42,8 @@ it('should scroll into view', async ({ page, server, isAndroid }) => {
}
});
it('should scroll zero-sized element into view', async ({ page, isAndroid, isElectron, browserName, isMac, macVersion }) => {
it('should scroll zero-sized element into view', async ({ page, isAndroid, isElectron }) => {
it.fixme(isAndroid || isElectron);
it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen.');
await page.setContent(`
<style>

View File

@ -18,7 +18,7 @@
import { test as it, expect } from './pageTest';
import { chromiumVersionLessThan } from '../config/utils';
it('should work @smoke', async ({ page, browserName, macVersion }) => {
it('should work @smoke', async ({ page, browserName, isMac }) => {
await page.setContent(`
<head>
<title>Accessibility Test</title>
@ -74,9 +74,7 @@ it('should work @smoke', async ({ page, browserName, macVersion }) => {
{ role: 'textbox', name: 'Input with whitespace', value: ' ' },
{ role: 'textbox', name: '', value: 'value only' },
{ role: 'textbox', name: 'placeholder', value: 'and a value' },
// due to frozen WebKit on macOS 11 we have the if/else here
// old webkit uses the description over placeholder for the name
{ role: 'textbox', name: macVersion >= 12 ? 'placeholder' : 'This is a description!', value: 'and a value' },
{ role: 'textbox', name: isMac ? 'placeholder' : 'This is a description!', value: 'and a value' },
]
};
expect(await page.accessibility.snapshot()).toEqual(golden);

View File

@ -144,8 +144,7 @@ it('should upload a file after popup', async ({ page, server, asset }) => {
expect(await page.evaluate(e => e.files[0].name, input)).toBe('file-to-upload.txt');
});
it('should upload large file', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {
it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');
it('should upload large file', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {
it.skip(isAndroid);
it.skip(isWebView2);
it.skip(mode.startsWith('service'));
@ -203,8 +202,7 @@ it('should throw an error if the file does not exist', async ({ page, server, as
expect(error.message).toContain('i actually do not exist.txt');
});
it('should upload multiple large files', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {
it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');
it('should upload multiple large files', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {
it.skip(isAndroid);
it.skip(isWebView2);
it.skip(mode.startsWith('service'));
@ -244,8 +242,7 @@ it('should upload multiple large files', async ({ page, server, browserName, isM
await Promise.all(uploadFiles.map(path => fs.promises.unlink(path)));
});
it('should upload large file with relative path', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode, macVersion }, testInfo) => {
it.skip(browserName === 'webkit' && isMac && macVersion < 11, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.');
it('should upload large file with relative path', async ({ page, server, isAndroid, isWebView2, mode }, testInfo) => {
it.skip(isAndroid);
it.skip(isWebView2);
it.skip(mode.startsWith('service'));