mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
test(player): a Safari perf run that fails says which wait timed out and why (#7347)
* test(player): a Safari perf run that fails says which wait timed out * test(player): a Safari run that never starts loading a video says so
This commit is contained in:
@@ -116,7 +116,14 @@ export async function bench(cfg) {
|
||||
const idle = await recordFrames(1000);
|
||||
|
||||
host.play();
|
||||
await until(() => runtime.isPlaying(), 5_000, "isPlaying");
|
||||
await until(() => runtime.isPlaying(), 5_000, "isPlaying").catch((e) => {
|
||||
// Safari sometimes reports a source as loading and never requests it; a reload does not help.
|
||||
const unstarted = videos()
|
||||
.filter((v) => v.readyState === 0 && v.networkState === 2)
|
||||
.map((v) => v.currentSrc.split("/").pop());
|
||||
if (unstarted.length === 0) throw e;
|
||||
throw new Error(`${e.message}: the browser never started loading ${unstarted.join(", ")}`);
|
||||
});
|
||||
countOps = true;
|
||||
const decodedBefore = decoded();
|
||||
const droppedTimeline = [];
|
||||
|
||||
@@ -262,7 +262,7 @@ async function runFilm(base: string, browser: Browser, origin: string, fixture:
|
||||
window.__bench = null;
|
||||
window.__hfBench(arguments[0]).then(
|
||||
(r) => { window.__bench = { ok: r }; },
|
||||
(e) => { window.__bench = { error: String(e && e.stack || e) }; });`,
|
||||
(e) => { window.__bench = { error: [String(e), e && e.stack].filter(Boolean).join("\\n") }; });`,
|
||||
args: [{ playMs: PLAY_MS, seekFractions: SEEK_FRACTIONS }],
|
||||
});
|
||||
const deadline = Date.now() + 180_000;
|
||||
|
||||
Reference in New Issue
Block a user