Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/player/tests/perf/browsers/bench-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/player/tests/perf/browsers/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading