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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-automation-position.html

Issue 2676873002: Convert Panner Audit tsets to testharness (Closed)
Patch Set: Remove finish task and some extra blank lines 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 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../resources/audit-util.js"></script> 6 <script src="../resources/audit-util.js"></script>
6 <script src="../resources/audio-testing.js"></script> 7 <script src="../resources/audio-testing.js"></script>
7 <script src="../resources/panner-formulas.js"></script> 8 <script src="../resources/panner-formulas.js"></script>
8 <title>Test Automation of PannerNode Positions</title> 9 <title>Test Automation of PannerNode Positions</title>
9 </head> 10 </head>
10 11
11 <body> 12 <body>
12 <script> 13 <script>
13 description("Test Automation of PannerNode Positions.");
14 window.jsTestIsAsync = true;
15
16 var sampleRate = 48000; 14 var sampleRate = 48000;
17 // These tests are quite slow, so don't run for many frames. 256 frames s hould be enough to 15 // These tests are quite slow, so don't run for many frames. 256 frames s hould be enough to
18 // demonstrate that automations are working. 16 // demonstrate that automations are working.
19 var renderFrames = 256; 17 var renderFrames = 256;
20 var renderDuration = renderFrames / sampleRate; 18 var renderDuration = renderFrames / sampleRate;
21 19
22 var context; 20 var context;
23 var panner; 21 var panner;
24 22
25 var audit = Audit.createTaskRunner(); 23 var audit = Audit.createTaskRunner();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 84 }
87 }; 85 };
88 86
89 var baseTestName = config.distanceModel.model + " rolloff: " + config.di stanceModel.rolloff; 87 var baseTestName = config.distanceModel.model + " rolloff: " + config.di stanceModel.rolloff;
90 88
91 // Define tasks for both 1-channel and 2-channel 89 // Define tasks for both 1-channel and 2-channel
92 audit.defineTask(k + ": 1-channel " + baseTestName, tester(config, 1)); 90 audit.defineTask(k + ": 1-channel " + baseTestName, tester(config, 1));
93 audit.defineTask(k + ": 2-channel " + baseTestName, tester(config, 2)); 91 audit.defineTask(k + ": 2-channel " + baseTestName, tester(config, 2));
94 } 92 }
95 93
96 audit.defineTask("finish", function (done) {
97 finishJSTest();
98 done();
99 });
100
101 audit.runTasks(); 94 audit.runTasks();
102 95
103 function runTest(options, channelCount) { 96 function runTest(options, channelCount) {
104 // Output has 5 channels: channels 0 and 1 are for the stereo output of the panner node. 97 // Output has 5 channels: channels 0 and 1 are for the stereo output of the panner node.
105 // Channels 2-5 are the for automation of the x,y,z coordinate so that w e have actual 98 // Channels 2-5 are the for automation of the x,y,z coordinate so that w e have actual
106 // coordinates used for the panner automation. 99 // coordinates used for the panner automation.
107 context = new OfflineAudioContext(5, renderFrames, sampleRate); 100 context = new OfflineAudioContext(5, renderFrames, sampleRate);
108 101
109 // Stereo source for the panner. 102 // Stereo source for the panner.
110 var source = context.createBufferSource(); 103 var source = context.createBufferSource();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 .beCloseToArray(expected0, errorThreshold); 250 .beCloseToArray(expected0, errorThreshold);
258 Should(prefix + "distanceModel: " + info + ", right channel", data1, { 251 Should(prefix + "distanceModel: " + info + ", right channel", data1, {
259 precision: 5 252 precision: 5
260 }) 253 })
261 .beCloseToArray(expected1, errorThreshold); 254 .beCloseToArray(expected1, errorThreshold);
262 }); 255 });
263 } 256 }
264 </script> 257 </script>
265 </body> 258 </body>
266 </html> 259 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698