products/Sources/formale Sprachen/C/Firefox/docs/contributing/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  test_playback_reactivate.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/media/test/test_playback_reactivate.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test playback with dormant of media files that should play OK</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

/* This testcase wants to test a video element's playback is not break
   by dormant.
   When the metadata is loaded, we remove the video element to trigger dormant.
   Then set a timer to append the video element back and play it.
   Test pass if the video plays to the end.
*/

var manager = new MediaTestManager;

function startTest(test, token) {
  const video = document.createElement('video');
  video.preload = "metadata";
  video.token = token;

  var handler = {
    "ontimeout": function() {
      Log(token, "timed out: ended=" + video.seenEnded + ", suspend=" + video.seenSuspend);
    }
  };
  manager.started(token, handler);

  video.src = test.name;
  video.name = test.name;

  var check = function() {
    is(test.name, video.name, test.name + ": Name should match #1");
    Log(video.token, "removeChild: " + video.name);
    document.body.removeChild(video);
    var appendAndPlayElement = function() {
      Log(video.token, "appendChild: " + video.name);
      document.body.appendChild(video);
      Log(video.token, "Element play: " + video.name);
      video.play();
    }
    setTimeout(appendAndPlayElement, 2000);
  };

  var finish = function() {
    video.finished = true;
    removeNodeAndSource(video);
    manager.finished(video.token);
  };

  var checkEnded = function() {
    is(test.name, video.name, test.name + ": Name should match #2");
    checkMetadata(test.name, video, test);
    is(video.readyState, video.HAVE_CURRENT_DATA, test.name + " checking readyState");
    ok(video.ended, test.name + " checking playback has ended");

    finish();
  };


  video.addEventListener("loadedmetadata", check);
  video.addEventListener("ended", checkEnded);

  document.body.appendChild(video);
}

manager.runTests(gSmallTests, startTest);

</script>
</pre>
</body>
</html>

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-09-30) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.