From 66e056c306bc2aca7fba22a1db15a5fe56c06003 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 12 Dec 2023 12:20:44 -0800 Subject: [PATCH] fix: disable PaintHolding to be able to click in oopifs (#28604) Fixes https://github.com/microsoft/playwright/issues/28023 --- .../src/server/chromium/chromiumSwitches.ts | 3 ++- tests/library/chromium/oopif.spec.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts index 65e458e81f..c3ceaeaaec 100644 --- a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts +++ b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts @@ -35,7 +35,8 @@ export const chromiumSwitches = [ // AvoidUnnecessaryBeforeUnloadCheckSync - https://github.com/microsoft/playwright/issues/14047 // Translate - https://github.com/microsoft/playwright/issues/16126 // HttpsUpgrades - https://github.com/microsoft/playwright/pull/27605 - '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades', + // PaintHolding - https://github.com/microsoft/playwright/issues/28023 + '--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding', '--allow-pre-commit-input', '--disable-hang-monitor', '--disable-ipc-flooding-protection', diff --git a/tests/library/chromium/oopif.spec.ts b/tests/library/chromium/oopif.spec.ts index 8a8db75745..5324e6d155 100644 --- a/tests/library/chromium/oopif.spec.ts +++ b/tests/library/chromium/oopif.spec.ts @@ -327,6 +327,20 @@ it('should emit filechooser event for iframe', async ({ page, server, browser }) expect(chooser).toBeTruthy(); }); +it('should be able to click in iframe', async ({ page, server, browser }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28023' }); + await page.goto(server.PREFIX + '/dynamic-oopif.html'); + expect(await countOOPIFs(browser)).toBe(1); + expect(page.frames().length).toBe(2); + const frame = page.frames()[1]; + await frame.setContent(``); + const [message] = await Promise.all([ + page.waitForEvent('console'), + frame.click('button'), + ]); + expect(message.text()).toBe('clicked'); +}); + it('should not throw on exposeFunction when oopif detaches', async ({ page, browser, server }) => { await page.goto(server.PREFIX + '/dynamic-oopif.html'); expect(await countOOPIFs(browser)).toBe(1);