tor-browser

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

test_webvtt_infinite_processing_loop.html (1289B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Bug 1580015 - video hangs infinitely during playing subtitle</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <script type="text/javascript" src="manifest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      8  <style>
      9    .container {
     10      width: 500px;
     11      height: 300px;
     12      background: pink;
     13      display: flex;
     14      justify-content: center;
     15    }
     16 
     17    video {
     18      min-width: 95%;
     19      max-width: 95%;
     20      max-height: 95%;
     21    }
     22  </style>
     23 </head>
     24 <body>
     25 <div class="container">
     26 <video id="v" src="gizmo.mp4" controls>
     27  <track src="basic.vtt" kind="subtitles" default>
     28 </video>
     29 </div>
     30 <script type="text/javascript">
     31 /**
     32 * This test is used to ensure that we don't go into an infinite processing loop
     33 * during playing subtitle when setting those CSS properties on video.
     34 */
     35 SimpleTest.waitForExplicitFinish();
     36 
     37 let video = document.getElementById("v");
     38 // We don't need to play whole video, in order to reduce test time, we can start
     39 // from the half, which can also reproduce the issue.
     40 video.currentTime = 3.0;
     41 video.play();
     42 video.onended = () => {
     43  ok(true, "video ends without entering an infinite processing loop");
     44  SimpleTest.finish();
     45 }
     46 
     47 </script>
     48 </body>
     49 </html>