summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface')
-rw-r--r--testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/.gitkeep0
-rw-r--r--testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html107
2 files changed, 107 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/.gitkeep b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/.gitkeep
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html
new file mode 100644
index 000000000..72ed88d3c
--- /dev/null
+++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html class="a">
+<head>
+<title>AudioBuffer IDL Test</title>
+<script src="/resources/testharness.js"></script><script src="/resources/testharnessreport.js"></script><script src="/resources/idlharness.js"></script><script src="/resources/WebIDLParser.js"></script><script src="/webaudio/js/lodash.js"></script><script src="/webaudio/js/vendor-prefixes.js"></script><script src="/webaudio/js/helpers.js"></script><style type="text/css">
+ #event-target-idl,
+ #audio-context-idl
+ { visibility:hidden; height: 0px;}
+ </style>
+</head>
+<body class="a">
+
+ <pre id="event-target-idl">interface EventTarget {
+ void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ boolean dispatchEvent(Event event);
+};
+
+/*
+callback interface EventListener {
+ void handleEvent(Event event);
+};
+*/
+// Callback interfaces are not supported yet, but that's ok
+interface EventListener {};
+</pre>
+
+ <pre id="audio-context-idl">callback DecodeSuccessCallback = void (AudioBuffer decodedData);
+callback DecodeErrorCallback = void ();
+
+[Constructor]
+interface AudioContext : EventTarget {
+
+ readonly attribute AudioDestinationNode destination;
+ readonly attribute float sampleRate;
+ readonly attribute double currentTime;
+ readonly attribute AudioListener listener;
+
+ AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
+
+ void decodeAudioData(ArrayBuffer audioData,
+ DecodeSuccessCallback successCallback,
+ optional DecodeErrorCallback errorCallback);
+
+
+ // AudioNode creation
+ AudioBufferSourceNode createBufferSource();
+
+ MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
+
+ MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
+ MediaStreamAudioDestinationNode createMediaStreamDestination();
+
+ ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
+ optional unsigned long numberOfInputChannels = 2,
+ optional unsigned long numberOfOutputChannels = 2);
+
+ AnalyserNode createAnalyser();
+ GainNode createGain();
+ DelayNode createDelay(optional double maxDelayTime = 1.0);
+ BiquadFilterNode createBiquadFilter();
+ WaveShaperNode createWaveShaper();
+ PannerNode createPanner();
+ ConvolverNode createConvolver();
+
+ ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
+ ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);
+
+ DynamicsCompressorNode createDynamicsCompressor();
+
+ OscillatorNode createOscillator();
+ PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
+
+};</pre>
+
+ <pre id="audio-buffer-idl">interface AudioBuffer {
+
+ readonly attribute float sampleRate;
+ readonly attribute long length;
+
+ // in seconds
+ readonly attribute double duration;
+
+ readonly attribute long numberOfChannels;
+
+ Float32Array getChannelData(unsigned long channel);
+
+};</pre>
+
+ <div id="log"></div>
+
+ <script>
+(function() {
+ var idl_array = new IdlArray();
+ idl_array.add_untested_idls(document.getElementById("event-target-idl").textContent);
+ idl_array.add_untested_idls(document.getElementById("audio-context-idl").textContent);
+ idl_array.add_idls(document.getElementById("audio-buffer-idl").textContent);
+
+ // For these tests the value of the arguments is unimportant.
+ audio_buffer = (new AudioContext).createBuffer(numberOfChannels = 1, length = 256, sampleRate = 44100);
+
+ idl_array.add_objects({AudioBuffer: ["audio_buffer"]});
+ idl_array.test();
+})();
+ </script>
+</body>
+</html>