tor-browser

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

vtt_update_display_after_removed_cue.html (926B)


      1 <!DOCTYPE HTML>
      2 <html class="reftest-wait">
      3 <head>
      4 </head>
      5 <body>
      6 <video id="v1" autoplay></video>
      7 <script type="text/javascript">
      8 
      9 /**
     10 * This test is used to ensure we would update the cue display after removing
     11 * cue from the text track, the removed cue should not display on the video's
     12 * rendering area.
     13 */
     14 function testUpdateDisplayAfterRemovedCue() {
     15  let video = document.getElementById("v1");
     16  video.src = "black.mp4";
     17  let cue = new VTTCue(0, 4, "hello testing");
     18  let track = video.addTextTrack("captions");
     19  track.mode = "showing";
     20  track.addCue(cue);
     21  cue.onenter = () => {
     22    cue.onenter = null;
     23    track.removeCue(cue);
     24    video.pause();
     25    video.onpause = () => {
     26      video.onpause = null;
     27      document.documentElement.removeAttribute('class');
     28    }
     29  }
     30 };
     31 
     32 window.addEventListener("MozReftestInvalidate",
     33                        testUpdateDisplayAfterRemovedCue);
     34 </script>
     35 </body>
     36 </html>