mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1558779 [wpt PR 17288] - Revert "Active Processing for ConvolverNode", a=testonly
Automatic update from web-platform-tests Revert "Active Processing for ConvolverNode" This reverts commit 499976c54a2b086bbde54ae137d0ac4adb3cd427. Reason for revert: Findit (https://goo.gl/kROfz5) identified CL at revision 668149 as the culprit for flakes in the build cycles as shown on: https://analysis.chromium.org/p/chromium/flake-portal/analysis/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vNDk5OTc2YzU0YTJiMDg2YmJkZTU0YWUxMzdkMGFjNGFkYjNjZDQyNww Sample Failed Build: https://ci.chromium.org/buildbot/chromium.mac/WebKit%20Mac10.13%20%28retina%29/15474 Sample Failed Step: webkit_layout_tests on ATI GPU on Mac Retina on Mac-10.13.6 Sample Flaky Test: external/wpt/webaudio/the-audio-api/the-convolvernode-interface/active-processing.https.html Original change's description: > Active Processing for ConvolverNode > > The ConvolverNode should output a single channel of silence when it is not > actively processing. Active processing is already supported and just needed > to have the convolver output a single channel of silence when it is > constructed, before anything is connected to it. > > Bug: 971389 > Change-Id: Icc894cd7ea6dec60a1eccb0fa4a3aea68ac5b51f > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1644899 > Commit-Queue: Raymond Toy <rtoy@chromium.org> > Reviewed-by: Hongchan Choi <hongchan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#668149} Change-Id: Ie7fedee332ca167c3dfd4fd99142de89234ff03a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 971389 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1653924 Cr-Commit-Position: refs/heads/master@{#668243} -- wp5At-commits: 2477f79f3c0757225d06762aeb1d3b1eea6eb52a wpt-pr: 17288
This commit is contained in:
parent
f0eb0c1809
commit
bf8053f15a
@ -1,101 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>
|
|
||||||
Test Active Processing for ConvolverNode
|
|
||||||
</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();
|
|
||||||
|
|
||||||
// Arbitrary sample rate. And we only need a few blocks for rendering to
|
|
||||||
// see if things are working.
|
|
||||||
let sampleRate = 8000;
|
|
||||||
let renderLength = 10 * RENDER_QUANTUM_FRAMES;
|
|
||||||
|
|
||||||
// Number of frames where the source is active. Fairly arbitrary, but
|
|
||||||
// should be more than one render quantum and significantly less than
|
|
||||||
// |renderLength|.
|
|
||||||
let srcDurationFrames = 131;
|
|
||||||
|
|
||||||
// Frame at which the source should be connected to the convolver.
|
|
||||||
let connectFrame = 2 * RENDER_QUANTUM_FRAMES;
|
|
||||||
|
|
||||||
// AudioProcessor that counts the number of channels on its single input.
|
|
||||||
let filePath =
|
|
||||||
'../the-audioworklet-interface/processors/input-count-processor.js';
|
|
||||||
|
|
||||||
audit.define(
|
|
||||||
{label: 'Test', description: 'Active processing for ConvolverNode'},
|
|
||||||
async (task, should) => {
|
|
||||||
const context = new OfflineAudioContext({
|
|
||||||
numberOfChannels: 2,
|
|
||||||
length: renderLength,
|
|
||||||
sampleRate: sampleRate
|
|
||||||
});
|
|
||||||
|
|
||||||
// Don't mix the inputs to the destination!
|
|
||||||
context.destination.channelInterpretation = 'discrete';
|
|
||||||
|
|
||||||
await context.audioWorklet.addModule(filePath);
|
|
||||||
|
|
||||||
// Impulse response for the convolver. Make it stereo so that
|
|
||||||
// the output is stereo. The length isn't too important.
|
|
||||||
let response = new AudioBuffer({
|
|
||||||
numberOfChannels: 2,
|
|
||||||
length: 150,
|
|
||||||
sampleRate: context.sampleRate
|
|
||||||
});
|
|
||||||
|
|
||||||
let src = new OscillatorNode(context);
|
|
||||||
let node = new ConvolverNode(context, {buffer: response});
|
|
||||||
let counter = new AudioWorkletNode(context, 'counter');
|
|
||||||
|
|
||||||
// Just to print a message that we created the graph with a
|
|
||||||
// convolver in it.
|
|
||||||
should(() => {
|
|
||||||
node.connect(counter).connect(context.destination);
|
|
||||||
}, 'Construction of graph with convolver').notThrow();
|
|
||||||
|
|
||||||
// Let the convolver run for a bit and then connect the source
|
|
||||||
// to it and start the source.
|
|
||||||
context.suspend(connectFrame / context.sampleRate)
|
|
||||||
.then(() => {
|
|
||||||
src.connect(node);
|
|
||||||
src.start();
|
|
||||||
// Stop the source after some small number of frames.
|
|
||||||
src.stop(
|
|
||||||
context.currentTime +
|
|
||||||
srcDurationFrames / context.sampleRate);
|
|
||||||
})
|
|
||||||
.then(() => context.resume());
|
|
||||||
|
|
||||||
const renderedBuffer = await context.startRendering();
|
|
||||||
const output = renderedBuffer.getChannelData(0);
|
|
||||||
// The convolver has a stereo response so it will produce
|
|
||||||
// stereo output for a mono or stereo input. Initially,
|
|
||||||
// nothing is connected to the convolver so it is not actively
|
|
||||||
// processing and therefore produces a single channel of
|
|
||||||
// silence. After a source is connected and started, the
|
|
||||||
// number of channels must be come 2. When the source stops,
|
|
||||||
// the convolver node is no longer actively processing and
|
|
||||||
// must then produce a single channel of silence.
|
|
||||||
//
|
|
||||||
// We're not concerned here about when the changes happens. We
|
|
||||||
// only care that the number of channels changed
|
|
||||||
// appropriately.
|
|
||||||
should(output, 'Number of output channels of convolver')
|
|
||||||
.containValues([1, 2, 1]);
|
|
||||||
task.done();
|
|
||||||
});
|
|
||||||
|
|
||||||
audit.run();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user