blob: dd0ef4174e2e964bbc9e0cf49aee4a4e87272af8 [file] [log] [blame]
<!DOCTYPE html>
<title>WebVTT two-cue layout after the first cue has ended</title>
<video style="border:1px solid gray">
<source src="../content/white.webm" type="video/webm">
<source src="../content/white.mp4" type="video/mp4">
// Without testRunner.layoutAndPaintAsyncThen there is no guarantee for when the first
// cue layout is done, so make no attempt to work without testRunner.
// Add two cues, where the first cue ends before the second.
var video = document.querySelector("video");
var track = video.addTextTrack("captions");
track.addCue(new VTTCue(0, 1, "cue 1"));
track.addCue(new VTTCue(0, 3, "cue 2"));
track.mode = "showing";
video.onloadeddata = function() {
testRunner.layoutAndPaintAsyncThen(function() {
// Seek past the end of the first cue. The second cue should not move.
video.currentTime = 2;
video.onseeked = function() { testRunner.notifyDone(); };