Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_delay_load.html   Sprache: HTML

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


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=479711
-->

<head>
  <title>Test for Bug 479711</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>
  <script>

  var gRegisteredElements = [];
  var testWindows = [];

  function register(v) {
    gRegisteredElements.push(v);
  }

  function loaded() {
    info("onload fired!");

    for (var i = 0; i < gRegisteredElements.length; ++i) {
      var v = gRegisteredElements[i];
      ok(v.readyState >= v.HAVE_CURRENT_DATA,
         v._name + ":" + v.id + " is not ready before onload fired (" + v.readyState + ")");
    }

    for (i=0; i<testWindows.length; ++i) {
      testWindows[i].close();
    }

    mediaTestCleanup();

    SimpleTest.finish();
  }

  addLoadEvent(loaded);

  </script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=479711">Mozilla Bug 479711</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 479711 **/

function createVideo(name, type, id) {
  var v = document.createElement("video");
  v.preload = "metadata";
  // Make sure each video is a unique resource
  v.src = name + "?" + id;
  v._name = name;
  v.id = id;
  register(v);
  return v;
}

var test = getPlayableVideo(gSmallTests);

// Straightforward add, causing a load.
var v = createVideo(test.name, test.type, "1");
document.body.appendChild(v);

// Load, add, then remove.
v = createVideo(test.name, test.type, "1");
v.load();
document.body.appendChild(v);
v.remove();

// Load and add.
v = createVideo(test.name, test.type, "2");
v.load();
document.body.appendChild(v);

// Load outside of doc.
v = createVideo(test.name, test.type, "3");
v.load();

// Open a new window for the following test. We open it here instead of in
// the event handler to ensure that our document load event doesn't fire while
// window.open is spinning the event loop.
var w = window.open("""testWindow""width=400,height=400");
testWindows.push(w);

v = createVideo(test.name, test.type, "4");
v.onloadstart = function() {
  // Using a new window to do this is a bit annoying, but if we use an iframe here,
  // delaying of the iframe's load event might interfere with the firing of our load event
  // in some confusing way. So it's simpler just to use another window.
  w.document.body.appendChild(v);
};
v.load(); // load started while in this document, this doc's load will block until
          // the video's finished loading (in the other document).

if (gRegisteredElements.length) {
  SimpleTest.waitForExplicitFinish();
} else {
  todo(false, "No types supported");
}

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

Messung V0.5
C=91 H=96 G=93

¤ Dauer der Verarbeitung: 0.25 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge