Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/compatibility.js"></script> | 6 <script src="../resources/compatibility.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 <title>Test Analyser.getByteTimeDomainData()</title> | 9 <title>Test Analyser.getByteTimeDomainData()</title> |
| 9 </head> | 10 </head> |
| 10 | 11 |
| 11 <body> | 12 <body> |
| 12 <script> | 13 <script> |
| 13 description("Test AnalyserNode getByteTimeDomainData"); | |
| 14 window.jsTestIsAsync = true; | 14 window.jsTestIsAsync = true; |
|
hongchan
2016/12/20 23:04:30
Remove this since it's from js-test.
Raymond Toy
2016/12/21 16:16:32
Done.
| |
| 15 | 15 |
| 16 var sampleRate = 48000; | 16 var sampleRate = 48000; |
| 17 // The size of the analyser frame. Anything larger than 128 is ok, but sh ould be long enough | 17 // The size of the analyser frame. Anything larger than 128 is ok, but sh ould be long enough |
| 18 // to capture the peaks of the oscillator waveform. | 18 // to capture the peaks of the oscillator waveform. |
| 19 var fftSize = 256; | 19 var fftSize = 256; |
| 20 // Number of frames to render. Should be greater than the fftSize, but is otherwise | 20 // Number of frames to render. Should be greater than the fftSize, but is otherwise |
| 21 // arbitrary. | 21 // arbitrary. |
| 22 var renderFrames = 2 * fftSize; | 22 var renderFrames = 2 * fftSize; |
| 23 | 23 |
| 24 var audit = Audit.createTaskRunner(); | 24 var audit = Audit.createTaskRunner(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 | 87 |
| 88 // Verify that all other samples are computed correctly. | 88 // Verify that all other samples are computed correctly. |
| 89 Should("Byte data", byteData).beEqualToArray(expected); | 89 Should("Byte data", byteData).beEqualToArray(expected); |
| 90 }).then(context.resume.bind(context)) | 90 }).then(context.resume.bind(context)) |
| 91 | 91 |
| 92 src.start(); | 92 src.start(); |
| 93 context.startRendering().then(done); | 93 context.startRendering().then(done); |
| 94 }); | 94 }); |
| 95 | 95 |
| 96 audit.defineTask("finish", function (done) { | 96 audit.defineTask("finish", function (done) { |
| 97 finishJSTest(); | |
| 98 done(); | 97 done(); |
| 99 }); | 98 }); |
| 100 | 99 |
| 101 audit.runTasks(); | 100 audit.runTasks(); |
| 102 </script> | 101 </script> |
| 103 </body> | 102 </body> |
| 104 </html> | 103 </html> |
| OLD | NEW |