tor-browser

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

test_seamless_looping_shorter_audio_than_video.html (1204B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <title>Seamless looping : shorter audio track than video track</title>
      5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      7 <script type="text/javascript" src="manifest.js"></script>
      8 </head>
      9 <script type="application/javascript">
     10 
     11 /**
     12 * This test is used to check whether we can play and loop a file in which the
     13 * audio track is shorter than its video track. The file we used in the test has
     14 * audio track (duration 3,001,000us), and video track (duration 3,047,000us)
     15 */
     16 add_task(async function testSeamlessLoopingShorterAudioTrack() {
     17  info(`create video and play it`);
     18  let video = document.createElement('video');
     19  video.loop = true;
     20  video.controls = true;
     21  video.src = "shorter_audio_than_video_3s.webm";
     22  document.body.appendChild(video);
     23  await video.play();
     24 
     25  info(`test seamless looping multiples times`);
     26  let MAX_LOOPING_COUNT = 1;
     27  for (let count = 0; count < MAX_LOOPING_COUNT; count++) {
     28    await once(video, "seeking");
     29    await once(video, "seeked");
     30    ok(true, `the round ${count} of the seamless looping succeeds`);
     31  }
     32 });
     33 
     34 </script>
     35 <body>
     36 </body>
     37 </html>