Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <!-- | 3 <!-- |
| 4 Test AudioBufferSourceNode supports 5.1 channel. | 4 Test AudioBufferSourceNode supports 5.1 channel. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <html> | 7 <html> |
| 8 <head> | 8 <head> |
| 9 <script src="../../resources/testharness.js"></script> | |
| 10 <script src="../../resources/testharnessreport.js"></script> | |
| 9 <script src="../resources/audit-util.js"></script> | 11 <script src="../resources/audit-util.js"></script> |
| 10 <script src="../resources/audio-testing.js"></script> | 12 <script src="../resources/audit.js"></script> |
| 11 <script type="text/javascript" src="../resources/mix-testing.js"></script> | 13 <script src="../resources/mix-testing.js"></script> |
| 12 </head> | 14 </head> |
| 13 <body> | 15 <body> |
| 14 | 16 |
| 15 <script> | 17 <script> |
| 18 let audit = Audit.createTaskRunner(); | |
| 16 | 19 |
| 17 function runTest() { | 20 audit.define('test', (task, should) => { |
| 18 if (!window.testRunner) | 21 should(window.testRunner, 'window.testRunner').notBeEqualTo(undefined); |
| 19 return; | |
| 20 | 22 |
| 21 testRunner.waitUntilDone(); | 23 testRunner.waitUntilDone(); |
| 22 | 24 |
| 23 window.jsTestAsync = true; | 25 // Create offline audio context |
| 26 let sampleRate = 44100.0; | |
| 27 let context = | |
| 28 new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sampleRate); | |
| 29 let toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6); | |
| 24 | 30 |
| 25 // Create offline audio context | 31 let source = context.createBufferSource(); |
| 26 var sampleRate = 44100.0; | 32 source.buffer = toneBuffer; |
| 27 var context = new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sam pleRate); | |
| 28 var toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6); | |
| 29 | 33 |
| 30 var source = context.createBufferSource(); | 34 source.connect(context.destination); |
| 31 source.buffer = toneBuffer; | 35 source.start(0); |
| 32 | 36 |
| 33 source.connect(context.destination); | 37 context.oncomplete = (event) => { |
|
hongchan
2017/02/27 18:05:35
promise?
| |
| 34 source.start(0); | 38 finishAudioTest(event); |
| 39 task.done(); | |
| 40 }; | |
| 41 context.startRendering(); | |
| 42 }); | |
| 35 | 43 |
| 36 context.oncomplete = finishAudioTest; | 44 audit.run(); |
| 37 context.startRendering(); | |
| 38 } | |
| 39 | |
| 40 runTest(); | |
| 41 </script> | 45 </script> |
| 42 | 46 |
| 43 </body> | 47 </body> |
| 44 </html> | 48 </html> |
| OLD | NEW |