| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 | 3 |
| 4 <head> | 4 <head> |
| 5 <title>Test AudioBufferSourceNode premature loop stop</title> | 5 <title>Test AudioBufferSourceNode premature loop stop</title> |
| 6 <script src="../../resources/js-test.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
| 7 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 8 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audio-testing.js"></script> | 9 <script src="../resources/audio-testing.js"></script> |
| 9 </head> | 10 </head> |
| 10 | 11 |
| 11 <body> | 12 <body> |
| 12 <script> | 13 <script> |
| 13 description("Test if AudioBufferSourceNode stops prematurely after the loop
attribute change."); | |
| 14 window.jsTestIsAsync = true; | |
| 15 | 14 |
| 16 // Reasonably low sample rate for the optimum test speed. | 15 // Reasonably low sample rate for the optimum test speed. |
| 17 var sampleRate = 4096; | 16 var sampleRate = 4096; |
| 18 | 17 |
| 19 var audit = Audit.createTaskRunner(); | 18 var audit = Audit.createTaskRunner(); |
| 20 | 19 |
| 21 // Task: Create a buffer with 3 regions filled with constant value of [1, 2, | 20 // Task: Create a buffer with 3 regions filled with constant value of [1, 2, |
| 22 // 3]. Then set a loop range over the second region. Start the loop and | 21 // 3]. Then set a loop range over the second region. Start the loop and |
| 23 // disable it in the middle of looping. Verify the rendered buffer has the | 22 // disable it in the middle of looping. Verify the rendered buffer has the |
| 24 // entire content including the looped region. | 23 // entire content including the looped region. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 var region2 = channel.subarray(regionLength, 4 * regionLength - 1); | 70 var region2 = channel.subarray(regionLength, 4 * regionLength - 1); |
| 72 var region3 = channel.subarray(4 * regionLength, 5 * regionLength - 1); | 71 var region3 = channel.subarray(4 * regionLength, 5 * regionLength - 1); |
| 73 | 72 |
| 74 Should('Region #1', region1).beConstantValueOf(1); | 73 Should('Region #1', region1).beConstantValueOf(1); |
| 75 Should('Region #2 (looped)', region2).beConstantValueOf(2); | 74 Should('Region #2 (looped)', region2).beConstantValueOf(2); |
| 76 Should('Region #3', region3).beConstantValueOf(3); | 75 Should('Region #3', region3).beConstantValueOf(3); |
| 77 }).then(done); | 76 }).then(done); |
| 78 }); | 77 }); |
| 79 | 78 |
| 80 audit.defineTask('finish', function (done) { | 79 audit.defineTask('finish', function (done) { |
| 81 finishJSTest(); | |
| 82 done(); | 80 done(); |
| 83 }); | 81 }); |
| 84 | 82 |
| 85 audit.runTasks(); | 83 audit.runTasks(); |
| 86 | 84 |
| 87 successfullyParsed = true; | 85 successfullyParsed = true; |
| 88 </script> | 86 </script> |
| 89 </body> | 87 </body> |
| 90 | 88 |
| 91 </html> | 89 </html> |
| OLD | NEW |