Bug 238130 - [WebGPU] Set the WebGPU WKPreference to true in layout tests
Summary: [WebGPU] Set the WebGPU WKPreference to true in layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-20 16:55 PDT by Myles C. Maxfield
Modified: 2022-03-21 13:46 PDT (History)
4 users (show)

See Also:


Attachments
Patch (9.04 KB, patch)
2022-03-20 17:04 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (11.65 KB, patch)
2022-03-20 22:44 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (2.77 KB, patch)
2022-03-21 13:38 PDT, Myles C. Maxfield
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2022-03-20 16:55:11 PDT
[WebGPU] Set the WebGPU WebPreference to true in layout tests
Comment 1 Myles C. Maxfield 2022-03-20 17:04:05 PDT
Created attachment 455209 [details]
Patch
Comment 2 Myles C. Maxfield 2022-03-20 17:11:27 PDT
Comment on attachment 455209 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=455209&action=review

> Source/WebKit/ChangeLog:9
> +        this patch adds a setter to WKPreferences, which is called by WebKitTestRunner.

I should mention that this is SPI, not API.
Comment 3 Myles C. Maxfield 2022-03-20 22:44:11 PDT
Created attachment 455215 [details]
Patch
Comment 4 Sam Weinig 2022-03-21 08:26:16 PDT
Comment on attachment 455215 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=455215&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:1593
> +- (void)_setWebGPUEnabled:(BOOL)enabled

This should not be necessary if the only place that wants to enable this is tests.

> Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:183
> +@property (nonatomic, setter=_setWebGPUEnabled:) BOOL _webgpuEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

This should not be necessary if the only place that wants to enable this is tests.

> Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:69
> +#define WebKitWebGPUEnabledPreferenceKey  @"WebKitWebGPU"

This should not be necessary if the only place that wants to enable this is tests.

> Source/WebKitLegacy/mac/WebView/WebPreferences.mm:942
> +- (void)setWebgpuEnabled:(BOOL)webgpuEnabled

This should not be necessary if the only place that wants to enable this is tests.

> Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h:259
> +@property (nonatomic) BOOL webgpuEnabled;

This should not be necessary if the only place that wants to enable this is tests.

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:882
> +        preferences.webgpuEnabled = YES;

Instead of using new SPI, you can just add the key to DumpRenderTree/TestOptions.cpp

> Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm:70
> +    [copiedConfiguration preferences]._webgpuEnabled = YES;

Instead of using new SPI, you can just add the key to WebKitTestRunner/TestOptions.cpp
Comment 5 Myles C. Maxfield 2022-03-21 13:38:03 PDT
Created attachment 455270 [details]
Patch
Comment 6 Myles C. Maxfield 2022-03-21 13:45:07 PDT
Committed r291578 (248678@trunk): <https://commits.webkit.org/248678@trunk>
Comment 7 Radar WebKit Bug Importer 2022-03-21 13:46:31 PDT
<rdar://problem/90590098>