blob: 718cadffc716f04548af6caeeca9e075846b6d46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<!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>
|