Chromium Code Reviews| Index: LayoutTests/webaudio/scriptprocessornode.html |
| diff --git a/LayoutTests/webaudio/scriptprocessornode.html b/LayoutTests/webaudio/scriptprocessornode.html |
| index 6919d74e08466f354c283ef861411e35bf348495..2f2b8de8b4132b270bdbcdd7b0383cca724c1087 100644 |
| --- a/LayoutTests/webaudio/scriptprocessornode.html |
| +++ b/LayoutTests/webaudio/scriptprocessornode.html |
| @@ -15,6 +15,7 @@ description("Tests ScriptProcessorNode."); |
| var sampleRate = 44100.0; |
| var outputChannels = 6; |
| +var playbackTime = 0.0; |
| // For the current implementation of ScriptProcessorNode, when it works with OfflineAudioContext (which runs much faster |
| // than real-time) the event.inputBuffer might be overwrite again before onaudioprocess ever get chance to be called. |
| @@ -39,6 +40,11 @@ function createBuffer(context, length) { |
| } |
| function processAudioData(event) { |
| + playbackTime = event.playbackTime; |
| + var expectedTime = context.currentTime + (bufferSize / context.sampleRate); |
| + var precision = 0.0000001; |
| + shouldBeCloseTo("playbackTime", expectedTime, precision, true); |
|
Raymond Toy
2014/03/27 18:52:20
Is there a reason playbackTime this is not EXACTLY
KhNo
2014/03/28 04:41:37
The reason that is not exactly same with expectedT
|
| + |
| buffer = event.outputBuffer; |
| if (buffer.numberOfChannels != outputChannels) |
| testFailed("numberOfOutputChannels doesn't match!"); |
| @@ -49,7 +55,7 @@ function processAudioData(event) { |
| buffer = event.inputBuffer; |
| var bufferDataL = buffer.getChannelData(0); |
| var bufferDataR = buffer.getChannelData(1); |
| - |
| + |
| var success = true; |
| // Go through every sample and make sure it's all -1 for the left-channel, and all +1 for the right-channel. |
| for (var i = 0; i < buffer.length; ++i) { |