feat(webkit): roll to r2029 (#31257)
This commit is contained in:
parent
2b257ea963
commit
e07b46883d
|
|
@ -27,7 +27,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "webkit",
|
"name": "webkit",
|
||||||
"revision": "2022",
|
"revision": "2029",
|
||||||
"installByDefault": true,
|
"installByDefault": true,
|
||||||
"revisionOverrides": {
|
"revisionOverrides": {
|
||||||
"mac10.14": "1446",
|
"mac10.14": "1446",
|
||||||
|
|
|
||||||
|
|
@ -2122,6 +2122,10 @@ export module Protocol {
|
||||||
* Array of <code>DOMNode</code> ids of any children marked as selected.
|
* Array of <code>DOMNode</code> ids of any children marked as selected.
|
||||||
*/
|
*/
|
||||||
selectedChildNodeIds?: NodeId[];
|
selectedChildNodeIds?: NodeId[];
|
||||||
|
/**
|
||||||
|
* On / off state of switch form controls.
|
||||||
|
*/
|
||||||
|
switchState?: "off"|"on";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* A structure holding an RGBA color.
|
* A structure holding an RGBA color.
|
||||||
|
|
@ -4584,6 +4588,14 @@ might return multiple quads for inline nodes.
|
||||||
}
|
}
|
||||||
export type resetPermissionsReturnValue = {
|
export type resetPermissionsReturnValue = {
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Overrides window.orientation with provided value.
|
||||||
|
*/
|
||||||
|
export type setOrientationOverrideParameters = {
|
||||||
|
angle?: number;
|
||||||
|
}
|
||||||
|
export type setOrientationOverrideReturnValue = {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -7351,14 +7363,6 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the
|
||||||
}
|
}
|
||||||
export type crashReturnValue = {
|
export type crashReturnValue = {
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Overrides window.orientation with provided value.
|
|
||||||
*/
|
|
||||||
export type setOrientationOverrideParameters = {
|
|
||||||
angle?: number;
|
|
||||||
}
|
|
||||||
export type setOrientationOverrideReturnValue = {
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Ensures that the scroll regions are up to date.
|
* Ensures that the scroll regions are up to date.
|
||||||
*/
|
*/
|
||||||
|
|
@ -9509,6 +9513,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the
|
||||||
"Emulation.setActiveAndFocused": Emulation.setActiveAndFocusedParameters;
|
"Emulation.setActiveAndFocused": Emulation.setActiveAndFocusedParameters;
|
||||||
"Emulation.grantPermissions": Emulation.grantPermissionsParameters;
|
"Emulation.grantPermissions": Emulation.grantPermissionsParameters;
|
||||||
"Emulation.resetPermissions": Emulation.resetPermissionsParameters;
|
"Emulation.resetPermissions": Emulation.resetPermissionsParameters;
|
||||||
|
"Emulation.setOrientationOverride": Emulation.setOrientationOverrideParameters;
|
||||||
"Heap.enable": Heap.enableParameters;
|
"Heap.enable": Heap.enableParameters;
|
||||||
"Heap.disable": Heap.disableParameters;
|
"Heap.disable": Heap.disableParameters;
|
||||||
"Heap.gc": Heap.gcParameters;
|
"Heap.gc": Heap.gcParameters;
|
||||||
|
|
@ -9591,7 +9596,6 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the
|
||||||
"Page.createUserWorld": Page.createUserWorldParameters;
|
"Page.createUserWorld": Page.createUserWorldParameters;
|
||||||
"Page.setBypassCSP": Page.setBypassCSPParameters;
|
"Page.setBypassCSP": Page.setBypassCSPParameters;
|
||||||
"Page.crash": Page.crashParameters;
|
"Page.crash": Page.crashParameters;
|
||||||
"Page.setOrientationOverride": Page.setOrientationOverrideParameters;
|
|
||||||
"Page.updateScrollingState": Page.updateScrollingStateParameters;
|
"Page.updateScrollingState": Page.updateScrollingStateParameters;
|
||||||
"Playwright.enable": Playwright.enableParameters;
|
"Playwright.enable": Playwright.enableParameters;
|
||||||
"Playwright.disable": Playwright.disableParameters;
|
"Playwright.disable": Playwright.disableParameters;
|
||||||
|
|
@ -9820,6 +9824,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the
|
||||||
"Emulation.setActiveAndFocused": Emulation.setActiveAndFocusedReturnValue;
|
"Emulation.setActiveAndFocused": Emulation.setActiveAndFocusedReturnValue;
|
||||||
"Emulation.grantPermissions": Emulation.grantPermissionsReturnValue;
|
"Emulation.grantPermissions": Emulation.grantPermissionsReturnValue;
|
||||||
"Emulation.resetPermissions": Emulation.resetPermissionsReturnValue;
|
"Emulation.resetPermissions": Emulation.resetPermissionsReturnValue;
|
||||||
|
"Emulation.setOrientationOverride": Emulation.setOrientationOverrideReturnValue;
|
||||||
"Heap.enable": Heap.enableReturnValue;
|
"Heap.enable": Heap.enableReturnValue;
|
||||||
"Heap.disable": Heap.disableReturnValue;
|
"Heap.disable": Heap.disableReturnValue;
|
||||||
"Heap.gc": Heap.gcReturnValue;
|
"Heap.gc": Heap.gcReturnValue;
|
||||||
|
|
@ -9902,7 +9907,6 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the
|
||||||
"Page.createUserWorld": Page.createUserWorldReturnValue;
|
"Page.createUserWorld": Page.createUserWorldReturnValue;
|
||||||
"Page.setBypassCSP": Page.setBypassCSPReturnValue;
|
"Page.setBypassCSP": Page.setBypassCSPReturnValue;
|
||||||
"Page.crash": Page.crashReturnValue;
|
"Page.crash": Page.crashReturnValue;
|
||||||
"Page.setOrientationOverride": Page.setOrientationOverrideReturnValue;
|
|
||||||
"Page.updateScrollingState": Page.updateScrollingStateReturnValue;
|
"Page.updateScrollingState": Page.updateScrollingStateReturnValue;
|
||||||
"Playwright.enable": Playwright.enableReturnValue;
|
"Playwright.enable": Playwright.enableReturnValue;
|
||||||
"Playwright.disable": Playwright.disableReturnValue;
|
"Playwright.disable": Playwright.disableReturnValue;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import os from 'os';
|
||||||
import { PNG, jpegjs } from '../../utilsBundle';
|
import { PNG, jpegjs } from '../../utilsBundle';
|
||||||
import { splitErrorMessage } from '../../utils/stackTrace';
|
import { splitErrorMessage } from '../../utils/stackTrace';
|
||||||
import { assert, createGuid, debugAssert, headersArrayToObject } from '../../utils';
|
import { assert, createGuid, debugAssert, headersArrayToObject } from '../../utils';
|
||||||
|
|
@ -713,7 +714,9 @@ export class WKPage implements PageDelegate {
|
||||||
];
|
];
|
||||||
if (options.isMobile) {
|
if (options.isMobile) {
|
||||||
const angle = viewportSize.width > viewportSize.height ? 90 : 0;
|
const angle = viewportSize.width > viewportSize.height ? 90 : 0;
|
||||||
promises.push(this._session.send('Page.setOrientationOverride', { angle }));
|
// Special handling for macOS 12.
|
||||||
|
const useLegacySetOrientationOverrideMethod = os.platform() === 'darwin' && parseInt(os.release().split('.')[0], 10) <= 21;
|
||||||
|
promises.push(this._pageProxySession.send(useLegacySetOrientationOverrideMethod ? 'Page.setOrientationOverride' as any : 'Emulation.setOrientationOverride', { angle }));
|
||||||
}
|
}
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { devices } from '@playwright/test';
|
||||||
import { contextTest as it, expect } from '../config/browserTest';
|
import { contextTest as it, expect } from '../config/browserTest';
|
||||||
import { browserTest } from '../config/browserTest';
|
import { browserTest } from '../config/browserTest';
|
||||||
import { verifyViewport } from '../config/utils';
|
import { verifyViewport } from '../config/utils';
|
||||||
|
|
@ -175,3 +176,13 @@ browserTest('should be able to get correct orientation angle on non-mobile devic
|
||||||
expect(await page.evaluate(() => window.screen.orientation.angle)).toBe(0);
|
expect(await page.evaluate(() => window.screen.orientation.angle)).toBe(0);
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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');
|
||||||
|
const context = await contextFactory(devices['iPhone 14']);
|
||||||
|
const page = await context.newPage();
|
||||||
|
await page.goto(server.PREFIX + '/index.html');
|
||||||
|
expect(await page.evaluate(() => window.screen.orientation.type)).toBe('portrait-primary');
|
||||||
|
await context.close();
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue