mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
fix(chromium): pass --enable-gpu when running headless (#30937)
Fixes #30585.
This commit is contained in:
parent
897f7449ef
commit
d0b052e1e0
@ -305,9 +305,12 @@ export class Chromium extends BrowserType {
|
|||||||
if (os.platform() === 'darwin') {
|
if (os.platform() === 'darwin') {
|
||||||
// See https://github.com/microsoft/playwright/issues/7362
|
// See https://github.com/microsoft/playwright/issues/7362
|
||||||
chromeArguments.push('--enable-use-zoom-for-dsf=false');
|
chromeArguments.push('--enable-use-zoom-for-dsf=false');
|
||||||
|
}
|
||||||
|
if (options.headless) {
|
||||||
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1407025.
|
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1407025.
|
||||||
if (options.headless)
|
// See also https://github.com/microsoft/playwright/issues/30585
|
||||||
chromeArguments.push('--use-angle');
|
// and chromium fix at https://issues.chromium.org/issues/338414704.
|
||||||
|
chromeArguments.push('--enable-gpu');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.devtools)
|
if (options.devtools)
|
||||||
|
@ -110,7 +110,6 @@ it('should play audio @smoke', async ({ page, server, browserName, platform }) =
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should support webgl @smoke', async ({ page, 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 hasWebGL = await page.evaluate(() => {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
return !!canvas.getContext('webgl');
|
return !!canvas.getContext('webgl');
|
||||||
@ -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('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 === '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 hasWebGL2 = await page.evaluate(() => {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
|
Loading…
Reference in New Issue
Block a user