summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/option-test-processor.js
blob: 27e1da6325206124c85ba72a55db05ad8e6a9e41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * @class OptionTestProcessor
 * @extends AudioWorkletProcessor
 *
 * This processor class demonstrates the option passing feature by echoing the
 * received |nodeOptions| back to the node.
 */
class OptionTestProcessor extends AudioWorkletProcessor {
  constructor(nodeOptions) {
    super();
    this.port.postMessage(nodeOptions);
  }

  process() {
    return true;
  }
}

registerProcessor('option-test-processor', OptionTestProcessor);