| 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/audioparam-testing.js"></script> | 8 <script src="../resources/audioparam-testing.js"></script> |
| 8 <title>Test Scheduled Sources with Huge Time Limits</title> | 9 <title>Test Scheduled Sources with Huge Time Limits</title> |
| 9 </head> | 10 </head> |
| 10 | 11 |
| 11 <body> | 12 <body> |
| 12 <script> | 13 <script> |
| 13 description("Test Scheduled Sources with Huge Time Limits."); | |
| 14 window.jsTestIsAsync = true; | |
| 15 | 14 |
| 16 var sampleRate = 48000; | 15 var sampleRate = 48000; |
| 17 var renderFrames = 1000; | 16 var renderFrames = 1000; |
| 18 | 17 |
| 19 var audit = Audit.createTaskRunner(); | 18 var audit = Audit.createTaskRunner(); |
| 20 | 19 |
| 21 audit.defineTask("buffersource: huge stop time", function (done) { | 20 audit.defineTask("buffersource: huge stop time", function (done) { |
| 22 // We only need to generate a small number of frames for this test. | 21 // We only need to generate a small number of frames for this test. |
| 23 var context = new OfflineAudioContext(1, renderFrames, sampleRate); | 22 var context = new OfflineAudioContext(1, renderFrames, sampleRate); |
| 24 var src = context.createBufferSource(); | 23 var src = context.createBufferSource(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 54 context.startRendering().then(function (resultBuffer) { | 53 context.startRendering().then(function (resultBuffer) { |
| 55 var result = resultBuffer.getChannelData(0); | 54 var result = resultBuffer.getChannelData(0); |
| 56 // The buffer should not be empty. Just find the max and verify that
it's not zero. | 55 // The buffer should not be empty. Just find the max and verify that
it's not zero. |
| 57 var max = Math.max.apply(null, result); | 56 var max = Math.max.apply(null, result); |
| 58 Should("Peak amplitude from oscillator.stop(" + endTime + ")", max).be
GreaterThan(0); | 57 Should("Peak amplitude from oscillator.stop(" + endTime + ")", max).be
GreaterThan(0); |
| 59 }).then(done); | 58 }).then(done); |
| 60 }); | 59 }); |
| 61 | 60 |
| 62 | 61 |
| 63 audit.defineTask("finish", function (done) { | 62 audit.defineTask("finish", function (done) { |
| 64 finishJSTest(); | |
| 65 done(); | 63 done(); |
| 66 }); | 64 }); |
| 67 | 65 |
| 68 audit.runTasks(); | 66 audit.runTasks(); |
| 69 </script> | 67 </script> |
| 70 </body> | 68 </body> |
| 71 </html> | 69 </html> |
| OLD | NEW |