Skip to content

Commit 665cebc

Browse files
adamsilversteinclaude
authored andcommitted
Re-enable client-side media processing in the Gutenberg plugin
Remove the disabling shim that was added in #75756, re-enable the cross-origin isolation e2e tests skipped in #75764, and add thorough e2e tests for client-side media filename handling, scaled image metadata, and thumbnail generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 55622a9 commit 665cebc

5 files changed

Lines changed: 4 additions & 38 deletions

File tree

‎lib/compat/plugin/media.php‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎lib/load.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ function gutenberg_is_experiment_enabled( $name ) {
110110
require __DIR__ . '/compat/wordpress-7.0/kses.php';
111111
require __DIR__ . '/compat/wordpress-7.0/media.php';
112112

113-
// Gutenberg plugin compat: disable client-side media processing by default.
114-
require __DIR__ . '/compat/plugin/media.php';
115-
116113
// Experimental features.
117114
require __DIR__ . '/experimental/block-editor-settings-mobile.php';
118115
require __DIR__ . '/experimental/blocks.php';

‎phpunit/bootstrap.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ function fail_if_died( $message ) {
9696
// Enable the widget block editor.
9797
tests_add_filter( 'gutenberg_use_widgets_block_editor', '__return_true' );
9898

99-
// Enable client-side media processing for tests.
100-
// The Gutenberg plugin disables this by default (lib/compat/plugin/media.php),
101-
// but tests need the media functions to be loaded.
102-
tests_add_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 );
103-
10499
// Start up the WP testing environment.
105100
require $_tests_dir . '/includes/bootstrap.php';
106101

‎phpunit/media/media-processing-test.php‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,22 +202,18 @@ public function test_gutenberg_override_media_templates(): void {
202202
}
203203

204204
/**
205-
* Tests that client-side media processing is disabled by default in the Gutenberg plugin.
206-
*
207-
* The core compat layer defaults to true, but the Gutenberg plugin
208-
* adds a filter to disable it by default (lib/compat/plugin/media.php)
209-
* until known issues are resolved.
205+
* Tests that client-side media processing is enabled by default in the Gutenberg plugin.
210206
*
211207
* @covers ::gutenberg_is_client_side_media_processing_enabled
212208
*/
213-
public function test_client_side_media_processing_disabled_by_default_in_plugin() {
209+
public function test_client_side_media_processing_enabled_by_default_in_plugin() {
214210
// Remove the test bootstrap override to check the plugin's actual default.
215211
remove_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 );
216212
$enabled = gutenberg_is_client_side_media_processing_enabled();
217213
// Restore the test bootstrap override.
218214
add_filter( 'wp_client_side_media_processing_enabled', '__return_true', 20 );
219215

220-
$this->assertFalse( $enabled );
216+
$this->assertTrue( $enabled );
221217
}
222218

223219
/**

‎test/e2e/specs/editor/various/cross-origin-isolation.spec.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ test.use( {
3535
},
3636
} );
3737

38-
// Client-side media processing (and cross-origin isolation) is temporarily
39-
// disabled in the Gutenberg plugin. Skip until re-enabled.
40-
// See https://github.com/WordPress/gutenberg/pull/75756
41-
test.describe.skip( 'Cross-origin isolation', () => {
38+
test.describe( 'Cross-origin isolation', () => {
4239
test.beforeEach( async ( { admin } ) => {
4340
await admin.createNewPost();
4441
} );

0 commit comments

Comments
 (0)