Skip to content

Commit

Permalink
No cross-origin isolation in WebKit :(
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Dec 6, 2023
1 parent da31298 commit 63b1807
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
21 changes: 21 additions & 0 deletions tests/e2e/specs/crossOriginIsolation.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect } from '../fixtures';

test.describe( 'Cross-Origin Isolation', () => {
test( 'should be enabled by default', async ( {
admin,
page,
browserName,
} ) => {
test.skip(
browserName === 'webkit',
'No cross-origin isolation in Playwright WebKit builds yet, see https://github.com/microsoft/playwright/issues/28513'
);

await admin.createNewPost();

const crossOriginIsolated = await page.evaluate( () => {
return Boolean( window.crossOriginIsolated );
} );
expect( crossOriginIsolated ).toBe( true );
} );
} );
13 changes: 8 additions & 5 deletions tests/e2e/specs/imageBlock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ test.describe( 'Image block', () => {

test.skip(
browserName === 'webkit' && preference === 'webp-browser',
'Not supported on Webkit'
'WebKit does not currently support Canvas.toBlob with WebP'
);

const crossOriginIsolated = await page.evaluate( () => {
return Boolean( window.crossOriginIsolated );
} );
expect( crossOriginIsolated ).toBe( true );
test.skip(
browserName === 'webkit' &&
[ 'webp-ffmpeg', 'jpeg-vips', 'jpeg-mozjpeg' ].includes(
preference
),
'No cross-origin isolation in Playwright WebKit builds yet, see https://github.com/microsoft/playwright/issues/28513'
);

await page.evaluate( ( pref ) => {
window.wp.data
Expand Down

0 comments on commit 63b1807

Please sign in to comment.