Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 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/audit.js"></script> |
| 7 <script src="../resources/panner-model-testing.js"></script> | 8 <script src="../resources/panner-model-testing.js"></script> |
| 8 </head> | 9 </head> |
| 9 | 10 |
| 10 <body> | 11 <body> |
| 11 <div id="description"></div> | |
| 12 <div id="console"></div> | |
| 13 | |
| 14 <script> | 12 <script> |
| 15 description("Test equal-power panner model of AudioPannerNode with stereo source."); | 13 let audit = Audit.createTaskRunner(); |
| 16 | 14 |
| 17 // To test the panner, we create a number of panner nodes | 15 // To test the panner, we create a number of panner nodes |
| 18 // equally spaced on a semicircle at unit distance. The | 16 // equally spaced on a semicircle at unit distance. The |
| 19 // semicircle covers the azimuth range from -90 to 90 deg, | 17 // semicircle covers the azimuth range from -90 to 90 deg, |
| 20 // covering full left to full right. Each source is an impulse | 18 // covering full left to full right. Each source is an impulse |
| 21 // turning at a different time and we check that the rendered | 19 // turning at a different time and we check that the rendered |
| 22 // impulse has the expected gain. | 20 // impulse has the expected gain. |
| 23 function runTest() { | 21 audit.define( |
| 24 if (window.testRunner) { | 22 { |
| 25 testRunner.dumpAsText(); | 23 label: 'test', |
| 26 testRunner.waitUntilDone(); | 24 description: |
| 27 } | 25 'Equal-power panner model of AudioPannerNode with stereo source' |
| 26 }, | |
| 27 (task, should) => { | |
| 28 // Create offline audio context. | |
|
hongchan
2017/02/24 22:07:24
A redundant comment. Should we remove?
Raymond Toy
2017/02/24 22:19:24
Done.
| |
| 29 context = new OfflineAudioContext( | |
| 30 2, sampleRate * renderLengthSeconds, sampleRate); | |
| 28 | 31 |
| 29 window.jsTestIsAsync = true; | 32 createTestAndRun( |
| 30 | 33 context, should, nodesToCreate, 2, |
| 31 // Create offline audio context. | 34 function(panner, x, y, z) { |
| 32 context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); | 35 panner.setPosition(x, y, z); |
| 33 | 36 }) |
| 34 createTestAndRun(context, nodesToCreate, 2, function (panner, x, y, z) { | 37 .then(() => task.done()); |
| 35 panner.setPosition(x, y, z); | |
| 36 }); | 38 }); |
| 37 } | 39 |
| 38 | 40 audit.run(); |
| 39 runTest(); | |
| 40 successfullyParsed = true; | |
| 41 | |
| 42 </script> | 41 </script> |
| 43 | 42 |
| 44 </body> | 43 </body> |
| 45 </html> | 44 </html> |
| OLD | NEW |