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

Side by Side Diff: LayoutTests/webaudio/resources/waveshaper-testing.js

Issue 208943004: Update WebAudio layout tests to use unprefixed AudioContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add console.log to compatibility.js Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var context; 1 var context;
2 var lengthInSeconds = 2; 2 var lengthInSeconds = 2;
3 3
4 // Skip this many frames before comparing against reference to allow 4 // Skip this many frames before comparing against reference to allow
5 // a steady-state to be reached in the up-sampling filters. 5 // a steady-state to be reached in the up-sampling filters.
6 var filterStabilizeSkipFrames = 2048; 6 var filterStabilizeSkipFrames = 2048;
7 7
8 var numberOfCurveFrames = 65536; 8 var numberOfCurveFrames = 65536;
9 var waveShapingCurve; 9 var waveShapingCurve;
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 if (window.testRunner) { 148 if (window.testRunner) {
149 testRunner.dumpAsText(); 149 testRunner.dumpAsText();
150 testRunner.waitUntilDone(); 150 testRunner.waitUntilDone();
151 } 151 }
152 152
153 window.jsTestIsAsync = true; 153 window.jsTestIsAsync = true;
154 154
155 // Create offline audio context. 155 // Create offline audio context.
156 var numberOfRenderFrames = sampleRate * lengthInSeconds; 156 var numberOfRenderFrames = sampleRate * lengthInSeconds;
157 context = new webkitOfflineAudioContext(1, numberOfRenderFrames, sampleRate) ; 157 context = new OfflineAudioContext(1, numberOfRenderFrames, sampleRate);
158 158
159 // source -> waveshaper -> destination 159 // source -> waveshaper -> destination
160 var source = context.createBufferSource(); 160 var source = context.createBufferSource();
161 source.buffer = createToneBuffer(context, fundamentalFrequency, lengthInSeco nds, 1); 161 source.buffer = createToneBuffer(context, fundamentalFrequency, lengthInSeco nds, 1);
162 162
163 // Apply a non-linear distortion curve. 163 // Apply a non-linear distortion curve.
164 waveshaper = context.createWaveShaper(); 164 waveshaper = context.createWaveShaper();
165 waveshaper.curve = generateWaveShapingCurve(); 165 waveshaper.curve = generateWaveShapingCurve();
166 waveshaper.oversample = oversample; 166 waveshaper.oversample = oversample;
167 167
168 source.connect(waveshaper); 168 source.connect(waveshaper);
169 waveshaper.connect(context.destination); 169 waveshaper.connect(context.destination);
170 170
171 source.start(0); 171 source.start(0);
172 172
173 context.oncomplete = checkShapedCurve; 173 context.oncomplete = checkShapedCurve;
174 context.startRendering(); 174 context.startRendering();
175 } 175 }
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/resources/scriptprocessornode-testing.js ('k') | LayoutTests/webaudio/sample-accurate-scheduling.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698