summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/process-getter.https.html
blob: a4c59123a104600c148f620bb32c78f112fdd12a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<title>Test use of 'process' getter for AudioWorkletProcessor callback</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
const do_test = async (node_name) => {
  const context = new AudioContext();
  const filePath = `processors/${node_name}-processor.js`;
  await context.audioWorklet.addModule(filePath);
  const node = new AudioWorkletNode(context, node_name);
  const event = await new Promise((resolve) => {
    node.port.onmessage = resolve;
  });
  assert_equals(event.data.message, "done");
};

// Includes testing for https://github.com/WebAudio/web-audio-api/pull/2104
promise_test(async () => do_test('process-getter-test-prototype'),
             "'process' getter on prototype");

promise_test(async () => do_test('process-getter-test-instance'),
             "'process' getter on instance");
</script>