Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Plugin Name: Gutenberg Test Plugin: Enable Client-Side Media Processing
* Plugin URI: https://github.com/WordPress/gutenberg
* Author: Gutenberg Team
*
* @package gutenberg-test-enable-client-side-media-processing
*/

add_filter( 'wp_client_side_media_processing_enabled', '__return_true' );
23 changes: 20 additions & 3 deletions test/e2e/specs/editor/various/cross-origin-isolation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,34 @@
} );

test.describe( 'Cross-origin isolation', () => {
test.beforeAll( async ( { requestUtils } ) => {
// Client-side media processing (and cross-origin isolation) is
// temporarily disabled in the Gutenberg plugin.
// See https://github.com/WordPress/gutenberg/pull/75756
await requestUtils.activatePlugin(
'gutenberg-test-plugin-enable-client-side-media-processing'
);
} );

test.afterAll( async ( { requestUtils } ) => {
await requestUtils.deactivatePlugin(
'gutenberg-test-plugin-enable-client-side-media-processing'
);
} );

test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );

test( 'should be cross-origin isolated by default', async ( { page } ) => {
// Verify that cross-origin isolation IS enabled (default state
// now that client-side media processing is graduated).
test( 'should be cross-origin isolated when client-side media processing is enabled', async ( {
page,
} ) => {
// Verify that cross-origin isolation IS enabled when
// client-side media processing is active.
const isCrossOriginIsolated = await page.evaluate(
() => window.crossOriginIsolated
);
expect( isCrossOriginIsolated ).toBe( true );

Check failure on line 66 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled

1) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 64 | () => window.crossOriginIsolated 65 | ); > 66 | expect( isCrossOriginIsolated ).toBe( true ); | ^ 67 | } ); 68 | 69 | test( 'should render embed previews when cross-origin isolated', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:66:35

Check failure on line 66 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled

1) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 64 | () => window.crossOriginIsolated 65 | ); > 66 | expect( isCrossOriginIsolated ).toBe( true ); | ^ 67 | } ); 68 | 69 | test( 'should render embed previews when cross-origin isolated', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:66:35

Check failure on line 66 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled

1) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:58:2 › Cross-origin isolation › should be cross-origin isolated when client-side media processing is enabled Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 64 | () => window.crossOriginIsolated 65 | ); > 66 | expect( isCrossOriginIsolated ).toBe( true ); | ^ 67 | } ); 68 | 69 | test( 'should render embed previews when cross-origin isolated', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:66:35
} );

test( 'should render embed previews when cross-origin isolated', async ( {
Expand Down Expand Up @@ -111,7 +128,7 @@
await expect(
iframe,
'Embed iframe should have crossorigin attribute'
).toHaveAttribute( 'crossorigin', 'anonymous' );

Check failure on line 131 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes

2) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Embed iframe should have crossorigin attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "anonymous" Received: "" Timeout: 5000ms Call log: - Embed iframe should have crossorigin attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 129 | iframe, 130 | 'Embed iframe should have crossorigin attribute' > 131 | ).toHaveAttribute( 'crossorigin', 'anonymous' ); | ^ 132 | } ); 133 | 134 | test( 'should add credentialless attribute to embed iframes when supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:131:5

Check failure on line 131 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes

2) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Embed iframe should have crossorigin attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "anonymous" Received: "" Timeout: 5000ms Call log: - Embed iframe should have crossorigin attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 129 | iframe, 130 | 'Embed iframe should have crossorigin attribute' > 131 | ).toHaveAttribute( 'crossorigin', 'anonymous' ); | ^ 132 | } ); 133 | 134 | test( 'should add credentialless attribute to embed iframes when supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:131:5

Check failure on line 131 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes

2) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:113:2 › Cross-origin isolation › should add crossorigin attribute to embed iframes Error: Embed iframe should have crossorigin attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "anonymous" Received: "" Timeout: 5000ms Call log: - Embed iframe should have crossorigin attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 129 | iframe, 130 | 'Embed iframe should have crossorigin attribute' > 131 | ).toHaveAttribute( 'crossorigin', 'anonymous' ); | ^ 132 | } ); 133 | 134 | test( 'should add credentialless attribute to embed iframes when supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:131:5
} );

test( 'should add credentialless attribute to embed iframes when supported', async ( {
Expand Down Expand Up @@ -143,7 +160,7 @@
await expect(
iframe,
'Embed iframe should have credentialless attribute'
).toHaveAttribute( 'credentialless', '' );

Check failure on line 163 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported

3) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Embed iframe should have credentialless attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "" Received: serializes to the same string Timeout: 5000ms Call log: - Embed iframe should have credentialless attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 161 | iframe, 162 | 'Embed iframe should have credentialless attribute' > 163 | ).toHaveAttribute( 'credentialless', '' ); | ^ 164 | } ); 165 | 166 | test( 'should show placeholder for denylisted providers when credentialless not supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:163:5

Check failure on line 163 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported

3) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Embed iframe should have credentialless attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "" Received: serializes to the same string Timeout: 5000ms Call log: - Embed iframe should have credentialless attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 161 | iframe, 162 | 'Embed iframe should have credentialless attribute' > 163 | ).toHaveAttribute( 'credentialless', '' ); | ^ 164 | } ); 165 | 166 | test( 'should show placeholder for denylisted providers when credentialless not supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:163:5

Check failure on line 163 in test/e2e/specs/editor/various/cross-origin-isolation.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 4

[chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported

3) [chromium] › test/e2e/specs/editor/various/cross-origin-isolation.spec.js:134:2 › Cross-origin isolation › should add credentialless attribute to embed iframes when supported Error: Embed iframe should have credentialless attribute expect(locator).toHaveAttribute(expected) failed Locator: locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') Expected: "" Received: serializes to the same string Timeout: 5000ms Call log: - Embed iframe should have credentialless attribute with timeout 5000ms - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Block' }).last().locator('iframe.components-sandbox') 9 × locator resolved to <iframe width="610" height="18" class="components-sandbox" title="Embedded content from twitter.com" sandbox="allow-scripts allow-same-origin allow-presentation"></iframe> - unexpected value "null" 161 | iframe, 162 | 'Embed iframe should have credentialless attribute' > 163 | ).toHaveAttribute( 'credentialless', '' ); | ^ 164 | } ); 165 | 166 | test( 'should show placeholder for denylisted providers when credentialless not supported', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/cross-origin-isolation.spec.js:163:5
} );

test( 'should show placeholder for denylisted providers when credentialless not supported', async ( {
Expand Down
Loading