зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1466741 [wpt PR 11338] - Revert "WaveShaper must output non-zero values even if input is silent", a=testonly
Automatic update from web-platform-testsRevert "WaveShaper must output non-zero values even if input is silent" This reverts commit 325b492fe733ba4c8b2128069a0a232fea1789e3. Reason for revert: Broke webaudio/.../waveshaper-364379.html in webkit_layout_tests. See https://crbug.com/849535 Original change's description: > WaveShaper must output non-zero values even if input is silent > > If the curve for the WaveShaperNode is such that a zero input produces > a non-zero output, the WaveShaperNode needs to output that value even > if the input is silent (or disconnected). > > Do this by setting the tail time of the processor to 0 or infinity > depending on whether the curve specifies an output value of zero or > not, respectively. > > Bug: 807301 > Test: WaveShaper/silent-inputs.html > Change-Id: I6539d2e00f5d3e624ffaf2810944eb6d53d6f84b > Reviewed-on: https://chromium-review.googlesource.com/896266 > Commit-Queue: Raymond Toy <rtoy@chromium.org> > Reviewed-by: Hongchan Choi <hongchan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#564186} TBR=rtoy@chromium.org,hongchan@chromium.org Change-Id: I29fd96b1a9dd2b87db12867031399b069beba706 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 807301, 849535 Reviewed-on: https://chromium-review.googlesource.com/1086647 Reviewed-by: Matt Giuca <mgiuca@chromium.org> Commit-Queue: Matt Giuca <mgiuca@chromium.org> Cr-Commit-Position: refs/heads/master@{#564359} -- wpt-commits: fa5ee47808411c866d09ad6a34dccf383b097bca wpt-pr: 11338
This commit is contained in:
Родитель
98c6c9fc21
Коммит
9948a3da13
|
@ -378439,12 +378439,6 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.html": [
|
|
||||||
[
|
|
||||||
"/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.html",
|
|
||||||
{}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html": [
|
"webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html": [
|
||||||
[
|
[
|
||||||
"/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html",
|
"/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html",
|
||||||
|
@ -619138,10 +619132,6 @@
|
||||||
"f88431616d6a8084a3434c1606e3543178d019fb",
|
"f88431616d6a8084a3434c1606e3543178d019fb",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.html": [
|
|
||||||
"839e2468f0ba3d3e58a7e158e4e826410a375d19",
|
|
||||||
"testharness"
|
|
||||||
],
|
|
||||||
"webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html": [
|
"webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.html": [
|
||||||
"28cc01fdd27a3ff88f2e886bc625d4dfd15db742",
|
"28cc01fdd27a3ff88f2e886bc625d4dfd15db742",
|
||||||
"testharness"
|
"testharness"
|
||||||
|
|
|
@ -1,103 +0,0 @@
|
||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>
|
|
||||||
Test Silent Inputs to WaveShaperNode
|
|
||||||
</title>
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<script src="/webaudio/resources/audit-util.js"></script>
|
|
||||||
<script src="/webaudio/resources/audit.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script id="layout-test-code">
|
|
||||||
let audit = Audit.createTaskRunner();
|
|
||||||
let sampleRate = 16000;
|
|
||||||
|
|
||||||
// Identity curve for the wave shaper: the input value is mapped directly
|
|
||||||
// to the output value.
|
|
||||||
let identityCurve = [-1, 0, 1];
|
|
||||||
let nonZeroCurve = [0.5, 0.5, 0.5];
|
|
||||||
|
|
||||||
audit.define(
|
|
||||||
{
|
|
||||||
label: 'test-0',
|
|
||||||
description: 'curve output is non-zero for silent inputs'
|
|
||||||
},
|
|
||||||
(task, should) => {
|
|
||||||
let {context, source, shaper} =
|
|
||||||
setupGraph(nonZeroCurve, sampleRate, sampleRate);
|
|
||||||
|
|
||||||
source.offset.setValueAtTime(0, 0);
|
|
||||||
|
|
||||||
context.startRendering()
|
|
||||||
.then(audioBuffer => {
|
|
||||||
should(
|
|
||||||
audioBuffer.getChannelData(0),
|
|
||||||
'WaveShaper with silent inputs and curve ' +
|
|
||||||
JSON.stringify(shaper.curve))
|
|
||||||
.beConstantValueOf(0.5);
|
|
||||||
})
|
|
||||||
.then(() => task.done());
|
|
||||||
});
|
|
||||||
|
|
||||||
audit.define(
|
|
||||||
{
|
|
||||||
label: 'test-1',
|
|
||||||
description: '2x curve output is non-zero for silent inputs'
|
|
||||||
},
|
|
||||||
(task, should) => {
|
|
||||||
let {context, source, shaper} =
|
|
||||||
setupGraph(nonZeroCurve, sampleRate, sampleRate);
|
|
||||||
|
|
||||||
source.offset.setValueAtTime(0, 0);
|
|
||||||
shaper.overSample = '2x';
|
|
||||||
|
|
||||||
context.startRendering()
|
|
||||||
.then(audioBuffer => {
|
|
||||||
should(
|
|
||||||
audioBuffer.getChannelData(0),
|
|
||||||
'WaveShaper with ' + shaper.overSample +
|
|
||||||
' oversample, silent inputs, and curve ' +
|
|
||||||
JSON.stringify(shaper.curve))
|
|
||||||
.beConstantValueOf(0.5);
|
|
||||||
})
|
|
||||||
.then(() => task.done());
|
|
||||||
});
|
|
||||||
|
|
||||||
audit.define(
|
|
||||||
{
|
|
||||||
label: 'test-2',
|
|
||||||
description: 'curve output is non-zero for no inputs'
|
|
||||||
},
|
|
||||||
(task, should) => {
|
|
||||||
let {context, source, shaper} =
|
|
||||||
setupGraph(nonZeroCurve, sampleRate, sampleRate);
|
|
||||||
|
|
||||||
source.disconnect();
|
|
||||||
|
|
||||||
context.startRendering()
|
|
||||||
.then(audioBuffer => {
|
|
||||||
should(
|
|
||||||
audioBuffer.getChannelData(0),
|
|
||||||
'WaveShaper with no inputs and curve ' +
|
|
||||||
JSON.stringify(shaper.curve))
|
|
||||||
.beConstantValueOf(0.5);
|
|
||||||
})
|
|
||||||
.then(() => task.done());
|
|
||||||
});
|
|
||||||
|
|
||||||
function setupGraph(curve, testFrames, sampleRate) {
|
|
||||||
let context = new OfflineAudioContext(1, testFrames, sampleRate);
|
|
||||||
let source = new ConstantSourceNode(context);
|
|
||||||
let shaper = new WaveShaperNode(context, {curve: curve});
|
|
||||||
|
|
||||||
source.connect(shaper).connect(context.destination);
|
|
||||||
|
|
||||||
return {context: context, source: source, shaper: shaper};
|
|
||||||
}
|
|
||||||
|
|
||||||
audit.run();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Загрузка…
Ссылка в новой задаче