| OLD | NEW |
| 1 <!doctype> | 1 <!doctype> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/testharness.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script src="../resources/audit-util.js"></script> | 6 <script src="../resources/audit-util.js"></script> |
| 7 <script src="../resources/audit.js"></script> | 7 <script src="../resources/audit.js"></script> |
| 8 <script src="../resources/note-grain-on-testing.js"></script> | 8 <script src="../resources/note-grain-on-testing.js"></script> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 k], startEndFrames.end[k], k); | 80 k], startEndFrames.end[k], k); |
| 81 should(result.verified, "Pulse " + k + | 81 should(result.verified, "Pulse " + k + |
| 82 " contained the expected data") | 82 " contained the expected data") |
| 83 .beTrue(); | 83 .beTrue(); |
| 84 } | 84 } |
| 85 should(invalidGrainDataCount, | 85 should(invalidGrainDataCount, |
| 86 "Number of grains that did not contain the expected data") | 86 "Number of grains that did not contain the expected data") |
| 87 .beEqualTo(0); | 87 .beEqualTo(0); |
| 88 } | 88 } |
| 89 | 89 |
| 90 audit.define("note-grain-on-play", function(task, should) { | 90 audit.define({ |
| 91 task.describe("Test noteGrainOn offset rendering"); | 91 label: "note-grain-on-play", |
| 92 description: "Test noteGrainOn offset rendering" |
| 93 }, function(task, should) { |
| 92 // Create offline audio context. | 94 // Create offline audio context. |
| 93 context = new OfflineAudioContext(2, sampleRate * | 95 context = new OfflineAudioContext(2, sampleRate * |
| 94 renderTime, sampleRate); | 96 renderTime, sampleRate); |
| 95 | 97 |
| 96 // Create a linear ramp for testing noteGrainOn. | 98 // Create a linear ramp for testing noteGrainOn. |
| 97 linearRampBuffer = createSignalBuffer(context, | 99 linearRampBuffer = createSignalBuffer(context, |
| 98 function(k) { | 100 function(k) { |
| 99 // Want the ramp to start | 101 // Want the ramp to start |
| 100 // with 1, not 0. | 102 // with 1, not 0. |
| 101 return k + 1; | 103 return k + 1; |
| 102 }); | 104 }); |
| 103 | 105 |
| 104 let grainInfo = playAllGrains(context, linearRampBuffer, | 106 let grainInfo = playAllGrains(context, linearRampBuffer, |
| 105 numberOfTests); | 107 numberOfTests); |
| 106 | 108 |
| 107 grainOffsetTime = grainInfo.grainOffsetTimes; | 109 grainOffsetTime = grainInfo.grainOffsetTimes; |
| 108 | 110 |
| 109 context.startRendering() | 111 context.startRendering() |
| 110 .then(function(audioBuffer) { | 112 .then(function(audioBuffer) { |
| 111 checkResult(audioBuffer, should); | 113 checkResult(audioBuffer, should); |
| 112 task.done(); | 114 task.done(); |
| 113 }); | 115 }); |
| 114 }); | 116 }); |
| 115 | 117 |
| 116 audit.run(); | 118 audit.run(); |
| 117 </script> | 119 </script> |
| 118 </body> | 120 </body> |
| 119 </html> | 121 </html> |
| OLD | NEW |