<!DOCTYPEHTML>
<html>
<head>
<title>Test for promise in worklet</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">
async function runTestInIframe() {
if (!SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported()) {
SimpleTest.finish();
return;
}
// Log to test that JS::SetWarningReporter() setup is done for bug 1898684.
await SpecialPowers.pushPrefEnv(
{"set": [["javascript.options.wasm_verbose", true]]});
ok(window.isSecureContext, "Test should run in secure context"); var audioContext = new AudioContext();
ok(audioContext.audioWorklet instanceof AudioWorklet, "AudioContext.audioWorklet should be an instance of AudioWorklet");
audioContext.audioWorklet.addModule("worklet_promise.js")
.then(() => {
const node = new AudioWorkletNode(audioContext, 'promise');
node.port.onmessage = e => {
ok(e.data instanceof WebAssembly.Module, "The WasmModule has been compiled into the worklet.");
SimpleTest.finish();
}
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.