Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 | 3 |
| 4 <head> | 4 <head> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audio-testing.js"></script> | 8 <script src="../resources/audio-testing.js"></script> |
| 9 <script src="../resources/audiobuffersource-testing.js"></script> | 9 <script src="../resources/audiobuffersource-testing.js"></script> |
| 10 <script src="../resources/buffer-loader.js"></script> | 10 <script src="../resources/buffer-loader.js"></script> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 var expected = referenceBuffer.getChannelData(0); | 48 var expected = referenceBuffer.getChannelData(0); |
| 49 | 49 |
| 50 // Compare two buffers with arbitrary (yet reasonable) constraints. | 50 // Compare two buffers with arbitrary (yet reasonable) constraints. |
| 51 // There parameters are determined by try bot experiments. | 51 // There parameters are determined by try bot experiments. |
| 52 compareBuffersWithConstraints(actual, expected, { | 52 compareBuffersWithConstraints(actual, expected, { |
| 53 thresholdSNR: 92.72, | 53 thresholdSNR: 92.72, |
| 54 thresholdDiffULP: 0.985, | 54 thresholdDiffULP: 0.985, |
| 55 thresholdDiffCount: 0, | 55 thresholdDiffCount: 0, |
| 56 bitDepth: 16 | 56 bitDepth: 16 |
| 57 }); | 57 }); |
| 58 | 58 if (!window.testRunner) { |
| 59 // Always save the generated results if we're running in a browser. | |
| 60 var filename = 'audiobuffersource-playbackrate-modulation-actual.wav'; | |
| 61 downloadAudioBuffer(renderedBuffer, filename); | |
| 62 Should("Saved", true) | |
| 63 .summarize(filename, ""); | |
| 64 } | |
|
hongchan
2017/03/03 18:39:25
This section can be abstracted a function:
bool g
Raymond Toy
2017/03/03 18:43:10
Yes and no. For old Audit, Should is just a funct
| |
| 59 }).then(done); | 65 }).then(done); |
| 60 }); | 66 }); |
| 61 | 67 |
| 62 // Task: Create a new reference audio file. See .runTasks() below to run | 68 audit.runTasks(); |
| 63 // this task. | |
| 64 audit.defineTask('generate-reference', function (done) { | |
| 65 if (!window.testRunner) { | |
| 66 done(); | |
| 67 return; | |
| 68 } | |
| 69 | |
| 70 // With this setting, the playback rate will be changing continuously and | |
| 71 // repeatedly within the range of [0, 200] around 100Hz, based on the | |
| 72 // input from the oscillator. | |
| 73 createSawtoothWithModulation(context, 'playbackRate', 100, 100); | |
| 74 | |
| 75 // |finishAudioTest| will automatically create a reference audio file from | |
| 76 // the OAC rendering if the reference file does not exist. | |
| 77 context.oncomplete = finishAudioTest; | |
| 78 context.startRendering(); | |
| 79 testRunner.waitUntilDone(); | |
| 80 | |
| 81 done(); | |
| 82 }); | |
| 83 | |
| 84 audit.defineTask('finish', function (done) { | |
| 85 done(); | |
| 86 }); | |
| 87 | |
| 88 window.onload = function () { | |
| 89 audit.runTasks( | |
| 90 'load-reference', | |
| 91 'generate-verify', | |
| 92 'finish' | |
| 93 ); | |
| 94 }; | |
| 95 | |
| 96 // Use this task to generate a new reference audio file. Make sure to | |
| 97 // comment out .runTasks() above before use this. | |
| 98 // audit.runTasks('generate-reference'); | |
| 99 | |
| 100 successfullyParsed = true; | |
| 101 </script> | 69 </script> |
| 102 </body> | 70 </body> |
| 103 | 71 |
| 104 </html> | 72 </html> |
| OLD | NEW |