test: trace hidden-window throttle changes during dialog cleanup

This commit is contained in:
Neil
2026-09-05 20:38:45 -07:00
parent 1db8460393
commit aa6f8f130d
2 changed files with 17 additions and 1 deletions
@@ -4,6 +4,11 @@ export async function enableHiddenElectronCompositor(app: ElectronApplication):
await app.evaluate(({ BrowserWindow }) => {
if (process.env.ORCA_E2E_HEADLESS === '1' && process.env.ORCA_E2E_HEADFUL !== '1') {
for (const window of BrowserWindow.getAllWindows()) {
const original = window.webContents.setBackgroundThrottling.bind(window.webContents)
window.webContents.setBackgroundThrottling = (allowed) => {
console.info('[hidden-throttle-change] ' + JSON.stringify({ allowed, stack: new Error().stack }))
original(allowed)
}
window.webContents.setBackgroundThrottling(false)
}
}
+12 -1
View File
@@ -98,7 +98,18 @@ export async function closeOpenDialogs(page: Page): Promise<void> {
}
const cancel = dialog.getByRole('button', { name: 'Cancel', exact: true })
await ((await cancel.isVisible()) ? cancel.click() : page.keyboard.press('Escape'))
await expect(dialog).toBeHidden({ timeout: 3_000 })
try {
await expect(dialog).toBeHidden({ timeout: 3_000 })
} catch (error) {
console.info('[dialog-exit-diagnostic] ' + JSON.stringify(await dialog.evaluate((element) => ({
state: element.getAttribute('data-state'),
visibility: document.visibilityState,
animations: element.getAnimations().map((animation) => ({
playState: animation.playState, currentTime: animation.currentTime, pending: animation.pending
}))
}))))
throw error
}
}
await expect(page.getByRole('dialog')).toHaveCount(0, { timeout: 3_000 })
}