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 |