Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html

Issue 2799993002: Setting convolver buffer needs to update number of output channels (Closed)
Patch Set: Address review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/ConvolverNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html b/third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html
index 843c81e3ca3df6d3bc13d6cf731fd12f31075602..34a0486906035cc69720b18ab4d10bf013d789f5 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Convolver/convolver-response-4-chan.html
@@ -96,6 +96,51 @@
.then(() => task.done());
});
+ audit.define(
+ {
+ label: 'delayed buffer set',
+ description: 'Delayed set of 4-channel response'
+ },
+ (task, should) => {
+ // Don't really care about the output for this test. It's to verify
+ // we don't crash in a debug build when setting the convolver buffer
+ // after creating the graph.
+ let context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ let src = new OscillatorNode(context);
+ let convolver = new ConvolverNode(context, {
+ disableNormalization: true
+ });
+ let buffer = new AudioBuffer({
+ numberOfChannels: 4,
+ length: 4,
+ sampleRate: context.sampleRate
+ });
+
+ // Impulse responses for the convolver aren't important, as long as
+ // it's not all zeroes.
+ for (let k = 0; k < buffer.numberOfChannels; ++k) {
+ buffer.getChannelData(k).fill(1);
+ }
+
+ src.connect(convolver).connect(context.destination);
+
+ // Set the buffer after a few render quanta have passed. The actual
+ // value must be least one, but is otherwise arbitrary.
+ context.suspend(512 / context.sampleRate)
+ .then(() => convolver.buffer = buffer)
+ .then(() => context.resume());
+
+ src.start();
+ context.startRendering()
+ .then(audioBuffer => {
+ // Just make sure output is not silent.
+ should(audioBuffer.getChannelData(0),
+ 'Output with delayed setting of convolver buffer')
+ .notBeConstantValueOf(0);
+ })
+ .then(() => task.done());
+ });
+
function fourChannelResponseTest(options, should) {
// Create an 4-channel offline context. The first two channels are for
// the stereo output of the convolver and the next two channels are for
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/ConvolverNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698