| 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/audit-util.js"></script> | 6 <script src="../resources/audit-util.js"></script> |
| 6 <script src="../resources/audio-testing.js"></script> | 7 <script src="../resources/audio-testing.js"></script> |
| 7 <script src="../resources/panner-formulas.js"></script> | 8 <script src="../resources/panner-formulas.js"></script> |
| 8 <title>Test setValueCurveAtTime Copies the Curve Data</title> | 9 <title>Test setValueCurveAtTime Copies the Curve Data</title> |
| 9 </head> | 10 </head> |
| 10 | 11 |
| 11 <body> | 12 <body> |
| 12 <script> | 13 <script> |
| 13 description("Test setValueCurveAtTime Copies the Curve Data"); | |
| 14 window.jsTestIsAsync = true; | |
| 15 | 14 |
| 16 var sampleRate = 48000; | 15 var sampleRate = 48000; |
| 17 var renderFrames = 1024; | 16 var renderFrames = 1024; |
| 18 var renderDuration = renderFrames / sampleRate; | 17 var renderDuration = renderFrames / sampleRate; |
| 19 | 18 |
| 20 var audit = Audit.createTaskRunner(); | 19 var audit = Audit.createTaskRunner(); |
| 21 | 20 |
| 22 // Test that changing the curve array to setValueCurveAtTime doesn't | 21 // Test that changing the curve array to setValueCurveAtTime doesn't |
| 23 // change the automation output. | 22 // change the automation output. |
| 24 audit.defineTask("test-copy", function (done) { | 23 audit.defineTask("test-copy", function (done) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 source.start(); | 71 source.start(); |
| 73 | 72 |
| 74 context.startRendering().then(function (resultBuffer) { | 73 context.startRendering().then(function (resultBuffer) { |
| 75 var testData = resultBuffer.getChannelData(0); | 74 var testData = resultBuffer.getChannelData(0); |
| 76 var refData = resultBuffer.getChannelData(1); | 75 var refData = resultBuffer.getChannelData(1); |
| 77 | 76 |
| 78 // The test result and the reference should be identical since | 77 // The test result and the reference should be identical since |
| 79 // changing the curve data should not affect the automation. | 78 // changing the curve data should not affect the automation. |
| 80 var success = Should("setValueCurve output", testData).beEqualToArray(
refData); | 79 var success = Should("setValueCurve output", testData).beEqualToArray(
refData); |
| 81 | 80 |
| 82 if (success) | 81 Should("Changing the curve data", success) |
| 83 testPassed("Changing the curve data did not change the result."); | 82 .summarize("did not change the result", "unexpectedly changed the re
sult"); |
| 84 else | |
| 85 testFailed("Changing the curve data unexpectedly changed the result.
"); | |
| 86 }).then(done); | 83 }).then(done); |
| 87 }); | 84 }); |
| 88 | 85 |
| 89 audit.defineTask("finish", function (done) { | 86 audit.defineTask("finish", function (done) { |
| 90 finishJSTest(); | |
| 91 done(); | 87 done(); |
| 92 }); | 88 }); |
| 93 | 89 |
| 94 audit.runTasks(); | 90 audit.runTasks(); |
| 95 </script> | 91 </script> |
| 96 </body> | 92 </body> |
| 97 </html> | 93 </html> |
| OLD | NEW |