tor-browser

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

test_bug1113600.html (1269B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test that a video element captured to a stream mid-playback can be played to the end</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 <script class="testbody" type="text/javascript">
     12 PARALLEL_TESTS = 1;
     13 SimpleTest.requestCompleteLog();
     14 var manager = new MediaTestManager;
     15 
     16 function startTest(test, token) {
     17  var v = document.createElement('video');
     18  v.style = "background-color:#aca;";
     19  v.width = 160;
     20  v.height = 120;
     21 
     22  manager.started(token);
     23 
     24  v.src = test.name;
     25 
     26  v.ontimeupdate = function() {
     27    if (v.currentTime < test.duration / 4) {
     28      // Allow some time to pass before starting the capture.
     29      return;
     30    }
     31    v.ontimeupdate = null;
     32    v.mozCaptureStreamUntilEnded();
     33    info(test.name + " capture started at " + v.currentTime + ". Duration=" + test.duration);
     34  };
     35 
     36  v.onended = function() {
     37    ok(true, test.name + " ended");
     38    removeNodeAndSource(v);
     39    manager.finished(token);
     40  };
     41 
     42  document.body.appendChild(v);
     43  v.play();
     44 }
     45 
     46 manager.runTests(gSmallTests, startTest);
     47 </script>
     48 </pre>
     49 </body>
     50 </html>