(
opts: {
currentTime?: number;
start?: number;
duration?: number;
driftSamples?: number;
} = {},
)
| 735 | }); |
| 736 | |
| 737 | function makeEntry( |
| 738 | opts: { |
| 739 | currentTime?: number; |
| 740 | start?: number; |
| 741 | duration?: number; |
| 742 | driftSamples?: number; |
| 743 | } = {}, |
| 744 | ): DriftEntry { |
| 745 | // Include `pause`/`src` so `disconnectedCallback`'s teardown loop |
| 746 | // (`m.el.pause(); m.el.src = ""`) doesn't blow up when the player is |
| 747 | // removed at the end of the test — `_mirrorParentMediaTime` itself only |
| 748 | // touches `currentTime`. |
| 749 | const entry: DriftEntry = { |
| 750 | el: { |
| 751 | currentTime: opts.currentTime ?? 0, |
| 752 | src: "", |
| 753 | pause: vi.fn(), |
| 754 | }, |
| 755 | start: opts.start ?? 0, |
| 756 | duration: opts.duration ?? 100, |
| 757 | driftSamples: opts.driftSamples ?? 0, |
| 758 | }; |
| 759 | player._parentMedia.push(entry); |
| 760 | return entry; |
| 761 | } |
| 762 | |
| 763 | it("initializes new parent-media entries with driftSamples=0", () => { |
| 764 | // Mock Audio just for this test so the audio-src bootstrap path produces |
no outgoing calls
no test coverage detected