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

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

Issue 2766253002: Remove one more task.describe call (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/resources/audit.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 function runWaveShaperOversamplingTest(testParams) { 133 function runWaveShaperOversamplingTest(testParams) {
134 sampleRate = testParams.sampleRate; 134 sampleRate = testParams.sampleRate;
135 nyquist = 0.5 * sampleRate; 135 nyquist = 0.5 * sampleRate;
136 oversample = testParams.oversample; 136 oversample = testParams.oversample;
137 fundamentalFrequency = testParams.fundamentalFrequency; 137 fundamentalFrequency = testParams.fundamentalFrequency;
138 acceptableAliasingThresholdDecibels = testParams.acceptableAliasingThreshold Decibels; 138 acceptableAliasingThresholdDecibels = testParams.acceptableAliasingThreshold Decibels;
139 139
140 let audit = Audit.createTaskRunner(); 140 let audit = Audit.createTaskRunner();
141 141
142 audit.define("test", function (task, should) { 142 audit.define({
143 task.describe(testParams.description); 143 label: "test",
144 description: testParams.description
145 }, function (task, should) {
144 146
145 // Create offline audio context. 147 // Create offline audio context.
146 var numberOfRenderFrames = sampleRate * lengthInSeconds; 148 var numberOfRenderFrames = sampleRate * lengthInSeconds;
147 context = new OfflineAudioContext(1, numberOfRenderFrames, sampleRate); 149 context = new OfflineAudioContext(1, numberOfRenderFrames,
150 sampleRate);
148 151
149 // source -> waveshaper -> destination 152 // source -> waveshaper -> destination
150 var source = context.createBufferSource(); 153 var source = context.createBufferSource();
151 source.buffer = createToneBuffer(context, fundamentalFrequency, lengthIn Seconds, 1); 154 source.buffer = createToneBuffer(context, fundamentalFrequency,
155 lengthInSeconds, 1);
152 156
153 // Apply a non-linear distortion curve. 157 // Apply a non-linear distortion curve.
154 waveshaper = context.createWaveShaper(); 158 waveshaper = context.createWaveShaper();
155 waveshaper.curve = generateWaveShapingCurve(); 159 waveshaper.curve = generateWaveShapingCurve();
156 waveshaper.oversample = oversample; 160 waveshaper.oversample = oversample;
157 161
158 source.connect(waveshaper); 162 source.connect(waveshaper);
159 waveshaper.connect(context.destination); 163 waveshaper.connect(context.destination);
160 164
161 source.start(0); 165 source.start(0);
162 166
163 context.startRendering() 167 context.startRendering()
164 .then(buffer => checkShapedCurve(buffer, should)) 168 .then(buffer => checkShapedCurve(buffer, should))
165 .then(() => task.done()); 169 .then(() => task.done());
166 }); 170 });
167 171
168 audit.run(); 172 audit.run();
169 } 173 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/resources/audit.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698