Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webaudio/the-audio-api/the-audioworklet-interface/audioworklet-registerprocessor-called-on-globalthis.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>
Test AudioWorkletGlobalScope's registerProcessor() called on globalThis
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webaudio/resources/audit.js"></script>
</head>
<body>
<script id="layout-test-code">
const audit = Audit.createTaskRunner();
const realtimeContext = new AudioContext();
const filePath = 'processors/dummy-processor-globalthis.js';
audit.define('registerprocessor-called-on-globalthis', (task, should) => {
realtimeContext.audioWorklet.addModule(filePath).then(() => {
const dummyWorkletNode = new AudioWorkletNode(realtimeContext, 'dummy-globalthis');
should(dummyWorkletNode instanceof AudioWorkletNode,
'"dummyWorkletNode" is an instance of AudioWorkletNode').beTrue();
task.done();
});
});
audit.run();
</script>
</body>
</html>