tor-browser

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

test_seek_promise_bug1344357.html (915B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Media test: bug 1344357</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 <body>
     10 <pre id="test">
     11 
     12 <script>
     13 
     14 // This test always succeeds at runtime but should not cause any leaks at the end of mochitests.
     15 
     16 let manager = new MediaTestManager;
     17 
     18 function initTest(test, token) {
     19  manager.started(token);
     20 
     21  var win = window.open();
     22  var video = win.document.createElement("video");
     23  video.autoplay = true;
     24  video.src = "http://example.com/tests/dom/media/test/" + test.name;
     25  win.document.body.appendChild(video);
     26  video.currentTime = test.duration / 2;
     27  video.addEventListener("seeking", () => {
     28    win.close();
     29    manager.finished(token);
     30  }, true);
     31 }
     32 
     33 manager.runTests(gSmallTests, initTest);
     34 
     35 </script>