Files
orca/tests/tools/benchmarks/spinner-rendering/main.ts
T
aeddfa463d perf(renderer): avoid per-second spinner animation events (#19407)
* perf(renderer): avoid per-second spinner animation events

* fix(bench): ensure the Electron runtime before bench:spinners

The script launches Electron via Playwright but skipped ensure:electron-runtime,
which every other Electron-launching bench script runs first.

* docs(renderer): scope spinner pixel-tolerance claim to paused-animation checks

---------

Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
2026-09-07 19:29:53 -07:00

23 lines
833 B
TypeScript

import { app, BrowserWindow } from 'electron'
import path from 'node:path'
import { applyBackgroundActivationPolicy } from '../../../../src/main/window/foreground-activation-policy'
if (process.env.ORCA_BACKGROUND_LAUNCH !== '1') {
throw new Error('Spinner measurements require ORCA_BACKGROUND_LAUNCH=1')
}
app.setPath('userData', path.join(__dirname, 'profile'))
applyBackgroundActivationPolicy()
// Exercise the frame pipeline while keeping the native window hidden.
app.commandLine.appendSwitch('disable-backgrounding-occluded-windows')
app.commandLine.appendSwitch('disable-renderer-backgrounding')
void app.whenReady().then(async () => {
const window = new BrowserWindow({
show: false,
width: 1100,
height: 850,
webPreferences: { backgroundThrottling: false }
})
await window.loadURL('about:blank')
})