Eine aufbereitete Darstellung der Quelle

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

Benutzer

Impressum test_slowStart.html

  Sprache: HTML
 

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


<!DOCTYPE HTML>
<html>
<head>
  <title>Test AudioContext.currentTime</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("This test needs to periodically query the AudioContext's position.");
const CUBEB_INIT_DELAY = 5000;
// Delay audio stream start by a good 5 seconds
SpecialPowers.pushPrefEnv({"set": [["media.cubeb.slow_stream_init_ms",
    CUBEB_INIT_DELAY]]}, runTest);


function runTest() {
  let ac = new AudioContext();
  let notStartedYetCount = 0;
  let startWallClockTime = performance.now();
  is(ac.currentTime, 0"AudioContext.currentTime should be 0 initially");
  is(ac.state, "suspended""AudioContext.currentTime is initially suspended");
  let intervalHandle = setInterval(function() {
    if (ac.state == "running" || ac.currentTime > 0) {
      clearInterval(intervalHandle);
      return;
    }
    is(ac.currentTime, 0"AudioContext.currentTime is still 0");
    is(ac.state, "suspended""AudioContext.currentTime is still suspended");
    notStartedYetCount++;
  });
  ac.onstatechange = function() {
    is(ac.state, "running""The AudioContext eventually started.");
    var startDuration = performance.now() - startWallClockTime;
    info(`AudioContext start time with a delay of ${CUBEB_INIT_DELAY}): ${startDuration}`);
    ok(notStartedYetCount > 0"We should have observed the AudioContext in \"suspended\" state");
    ok(startDuration >= CUBEB_INIT_DELAY, "The AudioContext state transition was correct.");
    SimpleTest.finish();
  }
}

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

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

¤ 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.0.16Bemerkung:  (vorverarbeitet am  2026-06-10) ¤

*Bot Zugriff






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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik