Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chromium): pass --enable-gpu when running headless #30937

Merged
merged 1 commit into from
Jun 13, 2024
Merged
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
7 changes: 5 additions & 2 deletions packages/playwright-core/src/server/chromium/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,12 @@ export class Chromium extends BrowserType {
if (os.platform() === 'darwin') {
// See https://github.com/microsoft/playwright/issues/7362
chromeArguments.push('--enable-use-zoom-for-dsf=false');
}
if (options.headless) {
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1407025.
if (options.headless)
chromeArguments.push('--use-angle');
// See also https://github.com/microsoft/playwright/issues/30585
// and chromium fix at https://issues.chromium.org/issues/338414704.
chromeArguments.push('--enable-gpu');
}

if (options.devtools)
Expand Down
4 changes: 0 additions & 4 deletions tests/library/capabilities.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ it('should play audio @smoke', async ({ page, server, browserName, platform }) =
});

it('should support webgl @smoke', async ({ page, browserName, platform }) => {
it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216');
const hasWebGL = await page.evaluate(() => {
const canvas = document.createElement('canvas');
return !!canvas.getContext('webgl');
Expand All @@ -119,10 +118,7 @@ it('should support webgl @smoke', async ({ page, browserName, platform }) => {
});

it('should support webgl 2 @smoke', async ({ page, browserName, headless, isWindows, platform }) => {
it.skip(browserName === 'webkit', 'WebKit doesn\'t have webgl2 enabled yet upstream.');
it.fixme(browserName === 'firefox' && isWindows);
it.fixme(browserName === 'chromium' && !headless, 'chromium doesn\'t like webgl2 when running under xvfb');
it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216');

const hasWebGL2 = await page.evaluate(() => {
const canvas = document.createElement('canvas');
Expand Down
Loading