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_WASM.js")
.then(() => create_wasmModule())
.then(wasmModule => {
const node = new AudioWorkletNode(audioContext, 'wasm');
let msgId = 0;
node.port.onmessage = e => {
if (msgId++ == 0) {
ok(e.data.wasmModule instanceof WebAssembly.Module, "WasmModule received");
} else {
ok(e.data.sab instanceof SharedArrayBuffer, "SAB received");
SimpleTest.finish();
}
}
node.port.postMessage({wasmModule});
node.port.postMessage({sab: new SharedArrayBuffer(1024)});
node.connect(audioContext.destination);
});
}
</script>
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.