| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test linearRampToValue Updates the Param Value</title> | 4 <title>Test linearRampToValue Updates the Param Value</title> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.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 </head> | 9 </head> |
| 9 | 10 |
| 10 <body> | 11 <body> |
| 11 <script> | 12 <script> |
| 12 description("Test linearRampToValue Updates the Param Value"); | |
| 13 window.jsTestIsAsync = true; | |
| 14 | 13 |
| 15 var renderQuantumSize = 128; | 14 var renderQuantumSize = 128; |
| 16 // Should be a power of two to get rid of rounding errors when converting
between time and | 15 // Should be a power of two to get rid of rounding errors when converting
between time and |
| 17 // frame. | 16 // frame. |
| 18 var sampleRate = 4096; | 17 var sampleRate = 4096; |
| 19 var renderDuration = 1; | 18 var renderDuration = 1; |
| 20 // End time of the linear ramp automation | 19 // End time of the linear ramp automation |
| 21 var rampEndTime = renderDuration / 2; | 20 var rampEndTime = renderDuration / 2; |
| 22 | 21 |
| 23 var audit = Audit.createTaskRunner(); | 22 var audit = Audit.createTaskRunner(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 62 |
| 64 var frame = context.currentTime * sampleRate - 1; | 63 var frame = context.currentTime * sampleRate - 1; |
| 65 success = Should("gain.gain.value at frame " + frame, gain.gain.valu
e) | 64 success = Should("gain.gain.value at frame " + frame, gain.gain.valu
e) |
| 66 .beEqualTo(expected) && success; | 65 .beEqualTo(expected) && success; |
| 67 }).then(context.resume.bind(context)); | 66 }).then(context.resume.bind(context)); |
| 68 } | 67 } |
| 69 | 68 |
| 70 // Rock and roll! | 69 // Rock and roll! |
| 71 source.start(); | 70 source.start(); |
| 72 context.startRendering().then(function (result) { | 71 context.startRendering().then(function (result) { |
| 73 if (success) | 72 Should("linearRampToValue", success) |
| 74 testPassed("linearRampToValue properly set the AudioParam value."); | 73 .summarize("properly set the AudioParam value", |
| 75 else | 74 "did not properly set the AudioParam value"); |
| 76 testFailed("linearRampToValue did not properly set the AudioParam va
lue."); | |
| 77 }).then(done); | 75 }).then(done); |
| 78 }); | 76 }); |
| 79 | 77 |
| 80 audit.defineTask("finish", function (done) { | 78 audit.defineTask("finish", function (done) { |
| 81 finishJSTest(); | |
| 82 done(); | 79 done(); |
| 83 }); | 80 }); |
| 84 | 81 |
| 85 audit.runTasks(); | 82 audit.runTasks(); |
| 86 </script> | 83 </script> |
| 87 </body> | 84 </body> |
| 88 </html> | 85 </html> |
| OLD | NEW |