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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html

Issue 2672093002: Convert PeriodicWave Audit tests to testharness (Closed)
Patch Set: Clean up. Created 3 years, 10 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test PeriodicWave Normalization</title> 4 <title>Test PeriodicWave Normalization</title>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
7 <script src="../resources/audio-testing.js"></script> 8 <script src="../resources/audio-testing.js"></script>
8 </head> 9 </head>
9 10
10 <body> 11 <body>
11 <script> 12 <script>
12 description("Test PeriodicWave Normalization");
13 window.jsTestIsAsync = true;
14
15 var sampleRate = 48000; 13 var sampleRate = 48000;
16 var renderFrames = 6000; 14 var renderFrames = 6000;
17 var context; 15 var context;
18 var audit = Audit.createTaskRunner(); 16 var audit = Audit.createTaskRunner();
19 17
20 var testSet = [ 18 var testSet = [
21 // Test the default case where the two-arg createPeriodicWave is called. The waveform 19 // Test the default case where the two-arg createPeriodicWave is called. The waveform
22 // should be normalized. 20 // should be normalized.
23 { 21 {
24 name: "option-default/normalized", 22 name: "option-default/normalized",
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // name. 201 // name.
204 function actualTestName(name, index) { 202 function actualTestName(name, index) {
205 return index + ":" + name; 203 return index + ":" + name;
206 } 204 }
207 205
208 function defineTasks() { 206 function defineTasks() {
209 for (var k = 0; k < testSet.length; ++k) { 207 for (var k = 0; k < testSet.length; ++k) {
210 var test = testSet[k]; 208 var test = testSet[k];
211 audit.defineTask(actualTestName(test.name, k), defineTest(test)); 209 audit.defineTask(actualTestName(test.name, k), defineTest(test));
212 } 210 }
213
214 // Explicitly define the last test to finish up everything.
215 audit.defineTask(actualTestName("finish-tests", testSet.length), functio n (done) {
216 finishJSTest();
217 done();
218 });
219 } 211 }
220 212
221 // Run all of the tests defined in testSet.
222 function runAuditTests() {
223 var tests = testSet.map(function (value, index) {
224 return actualTestName(value.name, index);
225 }).concat(actualTestName("finish-tests", testSet.length));
226 audit.runTasks.apply(audit, tests);
227 };
228
229 defineTasks(); 213 defineTasks();
230 runAuditTests(); 214 audit.runTasks();
231 215
232 successfullyParsed = true; 216 successfullyParsed = true;
233 </script> 217 </script>
234 </body> 218 </body>
235 </html> 219 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698