tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

idlharness.https.window.js (2894B)


      1 // META: script=/resources/WebIDLParser.js
      2 // META: script=/resources/idlharness.js
      3 // META: timeout=long
      4 
      5 // https://webaudio.github.io/web-audio-api/
      6 
      7 'use strict';
      8 
      9 idl_test(
     10  ['webaudio'],
     11  ['cssom', 'uievents', 'mediacapture-streams', 'html', 'dom'],
     12  async idl_array => {
     13    idl_array.add_untested_idls('interface SVGElement {};');
     14 
     15    idl_array.add_objects({
     16      BaseAudioContext: [],
     17      AudioContext: ['context'],
     18      OfflineAudioContext: ['new OfflineAudioContext(1, 1, sample_rate)'],
     19      OfflineAudioCompletionEvent: [
     20        'new OfflineAudioCompletionEvent("", {renderedBuffer: buffer})'
     21      ],
     22      AudioBuffer: ['buffer'],
     23      AudioNode: [],
     24      AudioParam: ['new AudioBufferSourceNode(context).playbackRate'],
     25      AudioScheduledSourceNode: [],
     26      AnalyserNode: ['new AnalyserNode(context)'],
     27      AudioBufferSourceNode: ['new AudioBufferSourceNode(context)'],
     28      AudioDestinationNode: ['context.destination'],
     29      AudioListener: ['context.listener'],
     30      AudioProcessingEvent: [`new AudioProcessingEvent('', {
     31        playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer
     32      })`],
     33      BiquadFilterNode: ['new BiquadFilterNode(context)'],
     34      ChannelMergerNode: ['new ChannelMergerNode(context)'],
     35      ChannelSplitterNode: ['new ChannelSplitterNode(context)'],
     36      ConstantSourceNode: ['new ConstantSourceNode(context)'],
     37      ConvolverNode: ['new ConvolverNode(context)'],
     38      DelayNode: ['new DelayNode(context)'],
     39      DynamicsCompressorNode: ['new DynamicsCompressorNode(context)'],
     40      GainNode: ['new GainNode(context)'],
     41      IIRFilterNode: [
     42        'new IIRFilterNode(context, {feedforward: [1], feedback: [1]})'
     43      ],
     44      MediaElementAudioSourceNode: [
     45        'new MediaElementAudioSourceNode(context, {mediaElement: new Audio})'
     46      ],
     47      MediaStreamAudioDestinationNode: [
     48        'new MediaStreamAudioDestinationNode(context)'
     49      ],
     50      MediaStreamAudioSourceNode: [],
     51      MediaStreamTrackAudioSourceNode: [],
     52      OscillatorNode: ['new OscillatorNode(context)'],
     53      PannerNode: ['new PannerNode(context)'],
     54      PeriodicWave: ['new PeriodicWave(context)'],
     55      ScriptProcessorNode: ['context.createScriptProcessor()'],
     56      StereoPannerNode: ['new StereoPannerNode(context)'],
     57      WaveShaperNode: ['new WaveShaperNode(context)'],
     58      AudioWorklet: ['context.audioWorklet'],
     59      AudioWorkletGlobalScope: [],
     60      AudioParamMap: ['worklet_node.parameters'],
     61      AudioWorkletNode: ['worklet_node'],
     62      AudioWorkletProcessor: [],
     63    });
     64 
     65    self.sample_rate = 44100;
     66    self.context = new AudioContext;
     67    self.buffer = new AudioBuffer({length: 1, sampleRate: sample_rate});
     68    await context.audioWorklet.addModule(
     69      'the-audio-api/the-audioworklet-interface/processors/dummy-processor.js');
     70    self.worklet_node = new AudioWorkletNode(context, 'dummy');
     71  }
     72 );