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..ad5349212b809a60fd89baa0f194ccc13457d984 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,46 @@ |
.then(() => task.done()); |
}); |
+ audit.define( |
+ { |
+ label: 'delayed buffer set', |
+ description: 'Delayed set of 4-channel response' |
+ }, |
+ (task, should) => { |
+ // Don't reall 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}); |
hongchan
2017/04/06 23:03:24
Please wrap at 80.
Raymond Toy
2017/04/07 14:51:48
Done.
|
+ let buffer = new AudioBuffer({numberOfChannels: 4, length: 4, |
+ sampleRate: context.sampleRate}); |
hongchan
2017/04/06 23:03:24
Not properly indented.
Raymond Toy
2017/04/07 14:51:48
Done.
|
+ |
+ 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(() => { |
hongchan
2017/04/06 23:03:24
We can remove the wrapping braces and make it into
Raymond Toy
2017/04/07 14:51:48
Done.
|
+ convolver.buffer = buffer; |
+ }) |
+ .then(() => context.resume()); |
+ |
+ src.start(); |
+ context.startRendering() |
+ .then(audioBuffer => { |
+ // Just make sure output is not silent |
hongchan
2017/04/06 23:03:24
super nit: add a period at the end.
Raymond Toy
2017/04/07 14:51:47
Done.
|
+ should(audioBuffer.getChannelData(0), |
+ "Output with delayed setting of convolver buffer") |
hongchan
2017/04/06 23:03:24
Please use single quotes.
Raymond Toy
2017/04/07 14:51:48
Done.
|
+ .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 |