diff options
Diffstat (limited to 'dom/media/webvtt/test/reftest/vtt_overlapping_time.html')
-rw-r--r-- | dom/media/webvtt/test/reftest/vtt_overlapping_time.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/dom/media/webvtt/test/reftest/vtt_overlapping_time.html b/dom/media/webvtt/test/reftest/vtt_overlapping_time.html new file mode 100644 index 0000000000..f973b398d5 --- /dev/null +++ b/dom/media/webvtt/test/reftest/vtt_overlapping_time.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html class="reftest-wait"> +<head> +</head> +<body> +<video id="v1" src="black.mp4" autoplay width="320" height="180"> + <track label="English" src="cues_time_overlapping.webvtt" default> +</video> +<script type="text/javascript"> +/** + * This test is to ensure that when cues with overlapping times, the one with + * earlier end timestamp should disappear when the media time reaches its + * end time. This vtt file contains two cues, the first cue is [0,1], the second + * cue is [0,4], so after video is playing over 1s, only cue2 should be displayed. + */ +async function testTimeOverlappingCues() { + const video = document.getElementById("v1"); + video.ontimeupdate = () => { + if (video.currentTime > 1.0) { + document.documentElement.removeAttribute('class'); + video.ontimeupdate = null; + } + } +}; + +window.addEventListener("MozReftestInvalidate", + testTimeOverlappingCues); +</script> +</body> +</html> |