test(engine): drive the empty-screenshot probe test with fake timers (#7000)

This commit is contained in:
Miguel Ángel
2026-11-09 16:31:08 +00:00
committed by GitHub
parent 7b30a50b51
commit c9fe041504
@@ -81,11 +81,18 @@ describe("BeginFrame capability probe", () => {
}),
} as unknown as Browser;
const result = await _probeBeginFrameSupportForTests(browser, 120);
vi.useFakeTimers();
try {
const probing = _probeBeginFrameSupportForTests(browser, 120);
await vi.advanceTimersByTimeAsync(200);
const result = await probing;
expect(result.supported).toBe(false);
expect(result.detail).toMatch(/returned 0 bytes after \d+ attempts in \d+ms/);
expect(result.timedOut).toBe(true);
expect(result.supported).toBe(false);
expect(result.detail).toMatch(/returned 0 bytes after \d+ attempts in \d+ms/);
expect(result.timedOut).toBe(true);
} finally {
vi.useRealTimers();
}
});
it("reports frames that are not a PNG as unsupported, not as a slow start", async () => {