| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="resources/compatibility.js"></script> | 4 <script src="resources/compatibility.js"></script> |
| 5 <script src="resources/audio-testing.js"></script> | 5 <script src="resources/audio-testing.js"></script> |
| 6 <script src="resources/audioparam-testing.js"></script> | 6 <script src="resources/audioparam-testing.js"></script> |
| 7 <script src="../resources/js-test.js"></script> | 7 <script src="../resources/js-test.js"></script> |
| 8 <title>Test setValueCurveAtTime with Huge Duration</title> | 8 <title>Test setValueCurveAtTime with Huge Duration</title> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 var max = Math.max.apply(null, result.getChannelData(0)); | 45 var max = Math.max.apply(null, result.getChannelData(0)); |
| 46 | 46 |
| 47 // The automation does linear interpolation between 0 and 1 from time
0 to duration. | 47 // The automation does linear interpolation between 0 and 1 from time
0 to duration. |
| 48 // Hence the max value of the interpolation occurs at the end of the
rendering. Compute | 48 // Hence the max value of the interpolation occurs at the end of the
rendering. Compute |
| 49 // this value. | 49 // this value. |
| 50 | 50 |
| 51 var expectedMax = (renderFrames / sampleRate) * (1 / duration); | 51 var expectedMax = (renderFrames / sampleRate) * (1 / duration); |
| 52 | 52 |
| 53 var message = "setValueCurve([" + curve + "], 0, " + duration + ")"; | 53 var message = "setValueCurve([" + curve + "], 0, " + duration + ")"; |
| 54 | 54 |
| 55 success = Should("Max amplitude of " + message, max).beLessThanOrEqua
lTo(expectedMax); | 55 success = Should("Max amplitude of " + message, max, { |
| 56 brief: true |
| 57 }).beLessThanOrEqualTo(expectedMax); |
| 56 | 58 |
| 57 if (success) | 59 if (success) |
| 58 testPassed(message + " correctly rendered.") | 60 testPassed(message + " correctly rendered.") |
| 59 else | 61 else |
| 60 testFailed(message + " incorrectly rendered with a peak value of "
+ max); | 62 testFailed(message + " incorrectly rendered with a peak value of "
+ max); |
| 61 }).then(done); | 63 }).then(done); |
| 62 }); | 64 }); |
| 63 | 65 |
| 64 audit.defineTask("finish", function (done) { | 66 audit.defineTask("finish", function (done) { |
| 65 finishJSTest(); | 67 finishJSTest(); |
| 66 done(); | 68 done(); |
| 67 }); | 69 }); |
| 68 | 70 |
| 69 audit.runTasks(); | 71 audit.runTasks(); |
| 70 </script> | 72 </script> |
| 71 </body> | 73 </body> |
| 72 </html> | 74 </html> |
| OLD | NEW |