fix(core): [CORE-SUBTITLE-OFFSET-01] refresh paused native cue membership and order

This commit is contained in:
Harvey Zhao committed 2026-09-14 12:49:22 +08:00
1 parent b5dee252d4
commit efed847cdf
23 files changed
+6789 -27

No files matched your search

@@ -38,7 +38,7 @@ async function seek(page, time) {
}
for (const core of cores.filter(core => !['published-5.1.2', 'published-5.1.7'].includes(core))) {
test(`Multiple subtitles candidate / ${core}: timed VTT and SRT, offsets, fullscreen and source change`, async ({ page, browser }, testInfo) => {
test(`Multiple subtitles candidate / ${core}: timed VTT and SRT, offsets, fullscreen and source change`, async ({ page, browser, browserName }, testInfo) => {
await prepare(page, core, candidate, browser, testInfo)
await page.evaluate(async () => {
await window.art.plugins.add(window.multipleFactory({ subtitles: [{ name: 'a', url: '/test/combination.vtt' }, { name: 'b', url: '/test/combination.srt' }] }))
@@ -54,14 +54,17 @@ for (const core of cores.filter(core => !['published-5.1.2', 'published-5.1.7'].
window.art.subtitleOffset = 1
})
expect(await page.evaluate(() => Array.from(window.art.template.$track.track.cues, cue => [cue.startTime, cue.endTime]))).toEqual([[2, 4], [2, 4], [5, 7]])
await expect(page.locator('.art-subtitle-a')).toHaveCount(0)
const staleHistoricalOffset = core !== 'candidate' && browserName === 'firefox'
await expect(page.locator('.art-subtitle-a')).toHaveCount(staleHistoricalOffset ? 1 : 0)
await seek(page, 2.5)
await expect(page.locator('.art-subtitle-a')).toHaveText('First')
await page.evaluate(() => {
window.art.subtitleOffset = -1
})
expect(await page.evaluate(() => Array.from(window.art.template.$track.track.cues, cue => [cue.startTime, cue.endTime]))).toEqual([[0, 2], [0, 2], [3, 5]])
await expect(page.locator('.art-subtitle-a')).toHaveCount(0)
await expect(page.locator('.art-subtitle-a')).toHaveCount(staleHistoricalOffset ? 1 : 0)
if (staleHistoricalOffset)
await testInfo.attach('historical-paused-offset-defect', { contentType: 'application/json', body: JSON.stringify({ core, browser: browser.version(), acceptedAsCorrect: false, observation: 'Published core keeps a stale active caption after paused offsets; candidate must clear it. Dedicated native/offset probes retain exact state.' }) })
await page.evaluate(() => {
window.art.subtitleOffset = 0
})