| 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/js-test.js"></script> |
| 5 <script src="../resources/audit-util.js"></script> | 5 <script src="../resources/audit-util.js"></script> |
| 6 <script src="../resources/audio-testing.js"></script> | 6 <script src="../resources/audio-testing.js"></script> |
| 7 </head> | 7 </head> |
| 8 | 8 |
| 9 <body> | 9 <body> |
| 10 <script> | 10 <script> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 context.suspend(context.currentTime + 0.1).then(function () { | 42 context.suspend(context.currentTime + 0.1).then(function () { |
| 43 context.resume(); | 43 context.resume(); |
| 44 })).beResolved(); | 44 })).beResolved(); |
| 45 | 45 |
| 46 context.resume(); | 46 context.resume(); |
| 47 }); | 47 }); |
| 48 | 48 |
| 49 context.startRendering().then(done); | 49 context.startRendering().then(done); |
| 50 }); | 50 }); |
| 51 | 51 |
| 52 // Task: suspending after rendering is finished must be rejected with the |
| 53 // properly clamped frame/time information. |
| 54 audit.defineTask('suspend-after-render-completion', function (done) { |
| 55 var context = new OfflineAudioContext( |
| 56 1, sampleRate * renderDuration, sampleRate); |
| 57 context.startRendering().then(function () { |
| 58 Should('Scheduling a suspend after the render completion', |
| 59 context.suspend(renderDuration)).beRejected(); |
| 60 }).then(done); |
| 61 }); |
| 62 |
| 52 // Task: Calling multiple suspends at the same rendering quantum should | 63 // Task: Calling multiple suspends at the same rendering quantum should |
| 53 // reject the promise. | 64 // reject the promise. |
| 54 audit.defineTask('identical-suspend-time', function (done) { | 65 audit.defineTask('identical-suspend-time', function (done) { |
| 55 var context = new OfflineAudioContext(1, sampleRate * renderDuration, sa
mpleRate); | 66 var context = new OfflineAudioContext(1, sampleRate * renderDuration, sa
mpleRate); |
| 56 | 67 |
| 57 // |suspendTime1| and |suspendTime2| are identical when quantized to | 68 // |suspendTime1| and |suspendTime2| are identical when quantized to |
| 58 // the render quantum size. | 69 // the render quantum size. |
| 59 var suspendTime1 = renderQuantum / sampleRate; | 70 var suspendTime1 = renderQuantum / sampleRate; |
| 60 var suspendTime2 = 1.5 * renderQuantum / sampleRate; | 71 var suspendTime2 = 1.5 * renderQuantum / sampleRate; |
| 61 | 72 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 }); | 127 }); |
| 117 | 128 |
| 118 audit.defineTask('finish', function (done) { | 129 audit.defineTask('finish', function (done) { |
| 119 finishJSTest(); | 130 finishJSTest(); |
| 120 done(); | 131 done(); |
| 121 }); | 132 }); |
| 122 | 133 |
| 123 audit.runTasks( | 134 audit.runTasks( |
| 124 'suspend-invalid-argument', | 135 'suspend-invalid-argument', |
| 125 'suspend-in-the-past', | 136 'suspend-in-the-past', |
| 137 'suspend-after-render-completion', |
| 126 'identical-suspend-time', | 138 'identical-suspend-time', |
| 127 'resume-before-suspend', | 139 'resume-before-suspend', |
| 128 'resume-without-suspend', | 140 'resume-without-suspend', |
| 129 'finish' | 141 'finish' |
| 130 ); | 142 ); |
| 131 | 143 |
| 132 successfullyParsed = true; | 144 successfullyParsed = true; |
| 133 </script> | 145 </script> |
| 134 | 146 |
| 135 </body> | 147 </body> |
| 136 </html> | 148 </html> |
| OLD | NEW |