mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 3f9178031eec5374c9a7d5709a7e11ba4a1955ed
This commit is contained in:
parent
4997ec26c2
commit
a5af9a106a
192 changed files with 3943 additions and 1927 deletions
|
@ -12,4 +12,18 @@
|
|||
assert_false(name in window);
|
||||
}, name + " interface should not exist");
|
||||
});
|
||||
|
||||
[
|
||||
"dopplerFactor",
|
||||
"speedOfSound",
|
||||
"setVelocity"
|
||||
].forEach(name => {
|
||||
test(function() {
|
||||
assert_false(name in AudioListener.prototype);
|
||||
}, name + " member should not exist on the AudioListener.");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_false("setVelocity" in PannerNode.prototype);
|
||||
}, "setVelocity should not exist on PannerNodes.");
|
||||
</script>
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebAudio IDL tests</title>
|
||||
<link rel="help" href="https://webaudio.github.io/web-audio-api/"/>
|
||||
<meta name="timeout" content="long"><!-- Heavy computation of the idl_objects -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
let sample_rate, context, buffer, worklet_node;
|
||||
|
||||
promise_test(async t => {
|
||||
const srcs = ['cssom', 'dom', 'html', 'uievents', 'mediacapture-streams', 'webaudio'];
|
||||
const [cssom, dom, html, uievents, mediacapture, webaudio] =
|
||||
await Promise.all(
|
||||
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));
|
||||
|
||||
const idl_array = new IdlArray();
|
||||
idl_array.add_idls(webaudio);
|
||||
|
||||
// Dependencies of HTML
|
||||
idl_array.add_dependency_idls(html);
|
||||
idl_array.add_dependency_idls(uievents);
|
||||
idl_array.add_dependency_idls(dom);
|
||||
idl_array.add_dependency_idls(mediacapture);
|
||||
idl_array.add_dependency_idls(cssom);
|
||||
|
||||
idl_array.add_untested_idls('interface SVGElement {};');
|
||||
idl_array.add_untested_idls('interface WorkletGlobalScope {};');
|
||||
idl_array.add_untested_idls('interface Worklet {};');
|
||||
|
||||
try {
|
||||
sample_rate = 44100;
|
||||
context = new AudioContext;
|
||||
buffer = new AudioBuffer({length: 1, sampleRate: sample_rate});
|
||||
await context.audioWorklet.addModule(
|
||||
'the-audio-api/the-audioworklet-interface/processors/dummy-processor.js');
|
||||
worklet_node = new AudioWorkletNode(context, 'dummy');
|
||||
} catch (e) {
|
||||
// Ignore - errors will surface in each test_object below.
|
||||
}
|
||||
|
||||
idl_array.add_objects({
|
||||
BaseAudioContext: [],
|
||||
AudioContext: ['context'],
|
||||
OfflineAudioContext: ['new OfflineAudioContext(1, 1, sample_rate)'],
|
||||
OfflineAudioCompletionEvent: [
|
||||
'new OfflineAudioCompletionEvent("", {renderedBuffer: buffer})'],
|
||||
AudioBuffer: ['buffer'],
|
||||
AudioNode: [],
|
||||
AudioParam: ['new AudioBufferSourceNode(context).playbackRate'],
|
||||
AudioScheduledSourceNode: [],
|
||||
AnalyserNode: ['new AnalyserNode(context)'],
|
||||
AudioBufferSourceNode: ['new AudioBufferSourceNode(context)'],
|
||||
AudioDestinationNode: ['context.destination'],
|
||||
AudioListener: ['context.listener'],
|
||||
AudioProcessingEvent: [`new AudioProcessingEvent('', {
|
||||
playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer
|
||||
})`],
|
||||
BiquadFilterNode: ['new BiquadFilterNode(context)'],
|
||||
ChannelMergerNode: ['new ChannelMergerNode(context)'],
|
||||
ChannelSplitterNode: ['new ChannelSplitterNode(context)'],
|
||||
ConstantSourceNode: ['new ConstantSourceNode(context)'],
|
||||
ConvolverNode: ['new ConvolverNode(context)'],
|
||||
DelayNode: ['new DelayNode(context)'],
|
||||
DynamicsCompressorNode: ['new DynamicsCompressorNode(context)'],
|
||||
GainNode: ['new GainNode(context)'],
|
||||
IIRFilterNode: [
|
||||
'new IIRFilterNode(context, {feedforward: [1], feedback: [1]})'
|
||||
],
|
||||
MediaElementAudioSourceNode: [
|
||||
'new MediaElementAudioSourceNode(context, {mediaElement: new Audio})'
|
||||
],
|
||||
MediaStreamAudioDestinationNode: [
|
||||
'new MediaStreamAudioDestinationNode(context)'
|
||||
],
|
||||
MediaStreamAudioSourceNode: [],
|
||||
MediaStreamTrackAudioSourceNode: [],
|
||||
OscillatorNode: ['new OscillatorNode(context)'],
|
||||
PannerNode: ['new PannerNode(context)'],
|
||||
PeriodicWave: ['new PeriodicWave(context)'],
|
||||
ScriptProcessorNode: ['context.createScriptProcessor()'],
|
||||
StereoPannerNode: ['new StereoPannerNode(context)'],
|
||||
WaveShaperNode: ['new WaveShaperNode(context)'],
|
||||
AudioWorklet: ['context.audioWorklet'],
|
||||
AudioWorkletGlobalScope: [],
|
||||
AudioParamMap: ['worklet_node.parameters'],
|
||||
AudioWorkletNode: ['worklet_node'],
|
||||
AudioWorkletProcessor: [],
|
||||
});
|
||||
idl_array.test();
|
||||
|
||||
}, 'Test driver');
|
||||
</script>
|
|
@ -0,0 +1,75 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
// META: timeout=long
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/
|
||||
|
||||
'use strict';
|
||||
|
||||
idl_test(
|
||||
['webaudio'],
|
||||
['cssom', 'uievents', 'mediacapture-streams', 'html', 'dom'],
|
||||
async idl_array => {
|
||||
idl_array.add_untested_idls('interface SVGElement {};');
|
||||
idl_array.add_untested_idls('interface WorkletGlobalScope {};');
|
||||
idl_array.add_untested_idls('interface Worklet {};');
|
||||
|
||||
idl_array.add_objects({
|
||||
BaseAudioContext: [],
|
||||
AudioContext: ['context'],
|
||||
OfflineAudioContext: ['new OfflineAudioContext(1, 1, sample_rate)'],
|
||||
OfflineAudioCompletionEvent: [
|
||||
'new OfflineAudioCompletionEvent("", {renderedBuffer: buffer})'
|
||||
],
|
||||
AudioBuffer: ['buffer'],
|
||||
AudioNode: [],
|
||||
AudioParam: ['new AudioBufferSourceNode(context).playbackRate'],
|
||||
AudioScheduledSourceNode: [],
|
||||
AnalyserNode: ['new AnalyserNode(context)'],
|
||||
AudioBufferSourceNode: ['new AudioBufferSourceNode(context)'],
|
||||
AudioDestinationNode: ['context.destination'],
|
||||
AudioListener: ['context.listener'],
|
||||
AudioProcessingEvent: [`new AudioProcessingEvent('', {
|
||||
playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer
|
||||
})`],
|
||||
BiquadFilterNode: ['new BiquadFilterNode(context)'],
|
||||
ChannelMergerNode: ['new ChannelMergerNode(context)'],
|
||||
ChannelSplitterNode: ['new ChannelSplitterNode(context)'],
|
||||
ConstantSourceNode: ['new ConstantSourceNode(context)'],
|
||||
ConvolverNode: ['new ConvolverNode(context)'],
|
||||
DelayNode: ['new DelayNode(context)'],
|
||||
DynamicsCompressorNode: ['new DynamicsCompressorNode(context)'],
|
||||
GainNode: ['new GainNode(context)'],
|
||||
IIRFilterNode: [
|
||||
'new IIRFilterNode(context, {feedforward: [1], feedback: [1]})'
|
||||
],
|
||||
MediaElementAudioSourceNode: [
|
||||
'new MediaElementAudioSourceNode(context, {mediaElement: new Audio})'
|
||||
],
|
||||
MediaStreamAudioDestinationNode: [
|
||||
'new MediaStreamAudioDestinationNode(context)'
|
||||
],
|
||||
MediaStreamAudioSourceNode: [],
|
||||
MediaStreamTrackAudioSourceNode: [],
|
||||
OscillatorNode: ['new OscillatorNode(context)'],
|
||||
PannerNode: ['new PannerNode(context)'],
|
||||
PeriodicWave: ['new PeriodicWave(context)'],
|
||||
ScriptProcessorNode: ['context.createScriptProcessor()'],
|
||||
StereoPannerNode: ['new StereoPannerNode(context)'],
|
||||
WaveShaperNode: ['new WaveShaperNode(context)'],
|
||||
AudioWorklet: ['context.audioWorklet'],
|
||||
AudioWorkletGlobalScope: [],
|
||||
AudioParamMap: ['worklet_node.parameters'],
|
||||
AudioWorkletNode: ['worklet_node'],
|
||||
AudioWorkletProcessor: [],
|
||||
});
|
||||
|
||||
self.sample_rate = 44100;
|
||||
self.context = new AudioContext;
|
||||
self.buffer = new AudioBuffer({length: 1, sampleRate: sample_rate});
|
||||
await context.audioWorklet.addModule(
|
||||
'the-audio-api/the-audioworklet-interface/processors/dummy-processor.js');
|
||||
self.worklet_node = new AudioWorkletNode(context, 'dummy');
|
||||
},
|
||||
'Test driver'
|
||||
);
|
|
@ -38,7 +38,7 @@
|
|||
let nodeOptions = {};
|
||||
nodeOptions[attrName] = -1;
|
||||
new PannerNode(context, nodeOptions);
|
||||
}, prefix + '-1})').throw('RangeError');
|
||||
}, prefix + '-1})').throw(RangeError);
|
||||
|
||||
if (options.isZeroAllowed) {
|
||||
should(function() {
|
||||
|
@ -51,7 +51,7 @@
|
|||
let nodeOptions = {};
|
||||
nodeOptions[attrName] = 0;
|
||||
new PannerNode(context, nodeOptions);
|
||||
}, prefix + '0})').throw('RangeError');
|
||||
}, prefix + '0})').throw(RangeError);
|
||||
}
|
||||
|
||||
// The smallest representable positive single float.
|
||||
|
@ -67,7 +67,7 @@
|
|||
panner = new PannerNode(context);
|
||||
should(function() {
|
||||
panner[attrName] = -1;
|
||||
}, prefix + '-1').throw('RangeError');
|
||||
}, prefix + '-1').throw(RangeError);
|
||||
|
||||
if (options.isZeroAllowed) {
|
||||
should(function() {
|
||||
|
@ -76,7 +76,7 @@
|
|||
} else {
|
||||
should(function() {
|
||||
panner[attrName] = 0;
|
||||
}, prefix + '0').throw('RangeError');
|
||||
}, prefix + '0').throw(RangeError);
|
||||
}
|
||||
|
||||
should(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue