chore: enable notification permission tests in WebKit (#31699)
The Notifications API has been supported in WebKit since 2022, enable related permission and tests.
This commit is contained in:
parent
f66f5b800e
commit
8021312c99
|
@ -1176,6 +1176,7 @@ export class WKPage implements PageDelegate {
|
||||||
async _grantPermissions(origin: string, permissions: string[]) {
|
async _grantPermissions(origin: string, permissions: string[]) {
|
||||||
const webPermissionToProtocol = new Map<string, string>([
|
const webPermissionToProtocol = new Map<string, string>([
|
||||||
['geolocation', 'geolocation'],
|
['geolocation', 'geolocation'],
|
||||||
|
['notifications', 'notifications'],
|
||||||
['clipboard-read', 'clipboard-read'],
|
['clipboard-read', 'clipboard-read'],
|
||||||
]);
|
]);
|
||||||
const filtered = permissions.map(permission => {
|
const filtered = permissions.map(permission => {
|
||||||
|
|
|
@ -22,7 +22,7 @@ function getPermission(page, name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
it.describe('permissions', () => {
|
it.describe('permissions', () => {
|
||||||
it.skip(({ browserName }) => browserName === 'webkit', 'Permissions API is not implemented in WebKit (see https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API)');
|
it.fixme(({ browserName, isWindows }) => browserName === 'webkit' && isWindows, 'Permissions API is disabled on Windows WebKit');
|
||||||
|
|
||||||
it('should be prompt by default', async ({ page, server }) => {
|
it('should be prompt by default', async ({ page, server }) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
@ -49,7 +49,7 @@ it.describe('permissions', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should grant window-management permission when origin is listed', async ({ page, context, server, browserName }) => {
|
it('should grant window-management permission when origin is listed', async ({ page, context, server, browserName }) => {
|
||||||
it.fail(browserName === 'firefox');
|
it.skip(browserName !== 'chromium', 'Only Chromium supports window management API.');
|
||||||
|
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
await context.grantPermissions(['window-management'], { origin: server.EMPTY_PAGE });
|
await context.grantPermissions(['window-management'], { origin: server.EMPTY_PAGE });
|
||||||
|
|
Loading…
Reference in New Issue