| OLD | NEW |
| 1 function runLateStartTest(audit, context, node) { | 1 function runLateStartTest(audit, context, node) { |
| 2 | 2 |
| 3 // Set up a dummy signal path to keep the audio context running and spend | 3 // Set up a dummy signal path to keep the audio context running and spend |
| 4 // processing time before calling start(0). | 4 // processing time before calling start(0). |
| 5 var osc = context.createOscillator(); | 5 var osc = context.createOscillator(); |
| 6 var silent = context.createGain(); | 6 var silent = context.createGain(); |
| 7 | 7 |
| 8 osc.connect(silent); | 8 osc.connect(silent); |
| 9 silent.connect(context.destination); | 9 silent.connect(context.destination); |
| 10 silent.gain.setValueAtTime(0.0, 0); | 10 silent.gain.setValueAtTime(0.0, 0); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 var success = | 38 var success = |
| 39 Should('The index of first non-zero value',nonZeroValueIndex) | 39 Should('The index of first non-zero value',nonZeroValueIndex) |
| 40 .notBeEqualTo(-1); | 40 .notBeEqualTo(-1); |
| 41 success = Should('The first sample value', channelData[0]) | 41 success = Should('The first sample value', channelData[0]) |
| 42 .beEqualTo(0) && success; | 42 .beEqualTo(0) && success; |
| 43 Should('The rendered buffer', success) | 43 Should('The rendered buffer', success) |
| 44 .summarize('contains non-zero values after the first sample', | 44 .summarize('contains non-zero values after the first sample', |
| 45 'was all zeros or has non-zero first sample.'); | 45 'was all zeros or has non-zero first sample.'); |
| 46 | |
| 47 done(); | 46 done(); |
| 48 }); | 47 }); |
| 49 }); | 48 }); |
| 50 | 49 |
| 51 audit.defineTask('finish-test', function (done) { | 50 audit.runTasks(); |
| 52 done(); | |
| 53 finishJSTest(); | |
| 54 }); | |
| 55 | |
| 56 audit.runTasks( | |
| 57 'test-late-start', | |
| 58 'finish-test' | |
| 59 ); | |
| 60 | |
| 61 } | 51 } |
| OLD | NEW |