tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

track-cue-negative-duration.html (858B)


      1 <!DOCTYPE html>
      2 <title>Enter, Exit events for a cue with negative duration</title>
      3 <script src="/common/media.js"></script>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <video>
      7  <script>
      8  async_test(function(t) {
      9    var video = document.querySelector("video");
     10    var track = video.addTextTrack("subtitles");
     11 
     12    // Add a cue with negative duration.
     13    var cue = new VTTCue(1, -10, "Sausage?");
     14    track.addCue(cue);
     15    assert_equals(track.cues.length, 1);
     16 
     17    // Verify that enter and exit events are fired.
     18    var enterEvent = false;
     19    cue.onenter = t.step_func(function() {
     20      enterEvent = true;
     21    });
     22    cue.onexit = t.step_func_done(function() {
     23      assert_true(enterEvent);
     24    });
     25 
     26    video.src = getVideoURI("/media/test");
     27    video.play();
     28  });
     29  </script>
     30 </video>