mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset f814a1a08de6 (bug 865241) for failing at least once per push since the test landed
This commit is contained in:
parent
e1d3d37020
commit
b4dd408494
@ -108,7 +108,6 @@ support-files =
|
||||
[test_pannerNode.html]
|
||||
[test_pannerNodeAbove.html]
|
||||
[test_pannerNodeChannelCount.html]
|
||||
[test_pannerNodeSymmetry.html]
|
||||
[test_pannerNodeTail.html]
|
||||
[test_pannerNode_equalPower.html]
|
||||
[test_periodicWave.html]
|
||||
|
@ -1,104 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test left/right symmetry and block-offset invariance of HRTF panner</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="webaudio.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const blockSize = 128;
|
||||
const bufferSize = 4096;
|
||||
|
||||
var ctx;
|
||||
var leftPannerOutput;
|
||||
var rightPannerOutput;
|
||||
|
||||
function isChannelSilent(channel) {
|
||||
for (var i = 0; i < channel.length; ++i) {
|
||||
if (channel[i] != 0.0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function startTest() {
|
||||
// Invert one signal so that mixing with the other will find the difference.
|
||||
var gain = ctx.createGain();
|
||||
gain.gain.value = -1.0;
|
||||
leftPannerOutput.connect(gain);
|
||||
|
||||
var processor = ctx.createScriptProcessor(bufferSize, 2, 0);
|
||||
gain.connect(processor);
|
||||
rightPannerOutput.connect(processor);
|
||||
processor.onaudioprocess =
|
||||
function(e) {
|
||||
compareBuffers(e.inputBuffer,
|
||||
ctx.createBuffer(2, bufferSize, ctx.sampleRate));
|
||||
e.target.onaudioprocess = null;
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
function prepareTest() {
|
||||
ctx = new AudioContext();
|
||||
var leftPanner = ctx.createPanner();
|
||||
var rightPanner = ctx.createPanner();
|
||||
leftPanner.setPosition(-1,0,0);
|
||||
rightPanner.setPosition(1,0,0);
|
||||
|
||||
// Test that PannerNode processes the signal consistently irrespective of
|
||||
// the offset in the processing block. This is done by inserting a delay of
|
||||
// less than a block size before one panner.
|
||||
const delayTime = 0.7 * blockSize / ctx.sampleRate;
|
||||
var leftDelay = ctx.createDelay(delayTime);
|
||||
leftDelay.delayTime.value = delayTime;
|
||||
leftDelay.connect(leftPanner);
|
||||
// and compensating for the delay after the other.
|
||||
var rightDelay = ctx.createDelay(delayTime);
|
||||
rightDelay.delayTime.value = delayTime;
|
||||
rightPanner.connect(rightDelay);
|
||||
|
||||
// Feed the panners with a signal having some harmonics to fill the spectrum.
|
||||
var oscillator = ctx.createOscillator();
|
||||
oscillator.frequency.value = 110;
|
||||
oscillator.type = "sawtooth";
|
||||
oscillator.connect(leftDelay);
|
||||
oscillator.connect(rightPanner);
|
||||
oscillator.start(0);
|
||||
|
||||
// Switch the channels on one panner output, and it should match the other.
|
||||
var splitter = ctx.createChannelSplitter();
|
||||
leftPanner.connect(splitter);
|
||||
var merger = ctx.createChannelMerger();
|
||||
splitter.connect(merger, 0, 1);
|
||||
splitter.connect(merger, 1, 0);
|
||||
|
||||
leftPannerOutput = merger;
|
||||
rightPannerOutput = rightDelay;
|
||||
|
||||
// A PannerNode will produce no output until it has loaded its HRIR
|
||||
// database. Wait for this to load before starting the test.
|
||||
var processor = ctx.createScriptProcessor(bufferSize, 2, 0);
|
||||
rightPanner.connect(processor);
|
||||
|
||||
processor.onaudioprocess =
|
||||
function(e) {
|
||||
if (isChannelSilent(e.inputBuffer.getChannelData(0)))
|
||||
return;
|
||||
|
||||
e.target.onaudioprocess = null;
|
||||
startTest();
|
||||
};
|
||||
}
|
||||
prepareTest();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user