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


Quelle  test_audioWorklet_options.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/worklet/tests/test_audioWorklet_options.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test for AudioWorklet + Options + WASM</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript" src="common.js"></script>
</head>
<body>
<script type="application/javascript">

function configureTest() {
  return SpecialPowers.pushPrefEnv(
    {"set": [
             ["dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", true],
             ["browser.tabs.remote.useCrossOriginOpenerPolicy", true],
             ["browser.tabs.remote.useCrossOriginEmbedderPolicy", true],
             ["javascript.options.shared_memory", true],
    ]});
}

function create_wasmModule() {
  return new Promise(resolve => {
    info("Checking if we can play with WebAssembly...");

    if (!SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported()) {
      resolve(null);
      return;
    }

    ok(WebAssembly, "WebAssembly object should exist");
    ok(WebAssembly.compile, "WebAssembly.compile function should exist");

    // eslint-disable-next-line no-unused-vars
    const wasmTextToBinary = SpecialPowers.unwrap(SpecialPowers.Cu.getJSTestingFunctions().wasmTextToBinary);

    /*
      js -e '
        t = wasmTextToBinary(`
          (module
            (func $foo (result i32) (i32.const 42))
            (export "foo" (func $foo))
          )
        `);
        print(t)
      '
    */
    const fooModuleCode = new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,127,3,2,1,0,7,7,1,3,102,111,111,0,0,10,6,1,4,0,65,42,11,0,13,4,110,97,109,101,1,6,1,0,3,102,111,111]);

    WebAssembly.compile(fooModuleCode).then(m => {
      ok(m instanceof WebAssembly.Module, "The WasmModule has been compiled.");
      resolve(m);
    }, () => {
      ok(false, "The compilation of the wasmModule failed.");
      resolve(null);
    });
  });
}

function runTestInIframe() {
  let audioContext = new AudioContext();
  audioContext.audioWorklet.addModule("worklet_audioWorklet_options.js")
  .then(() => create_wasmModule())
  .then(wasmModule => {
    const node = new AudioWorkletNode(audioContext, 'options', { processorOptions: {
      wasmModule, sab: new SharedArrayBuffer(1024),
    }});
    node.port.onmessage = e => {
      ok(e.data.wasmModule instanceof WebAssembly.Module, "WasmModule received");
      ok(e.data.sab instanceof SharedArrayBuffer, "SAB received");
      SimpleTest.finish();
    }

    node.connect(audioContext.destination);
  });
}

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

Messung V0.5
C=86 H=97 G=91

¤ Dauer der Verarbeitung: 0.20 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