| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title> | 4 <title> |
| 5 audioparam-method-chaining.html | 5 audioparam-method-chaining.html |
| 6 </title> | 6 </title> |
| 7 <script src="../../resources/testharness.js"></script> | 7 <script src="../../resources/testharness.js"></script> |
| 8 <script src="../../resources/testharnessreport.js"></script> | 8 <script src="../../resources/testharnessreport.js"></script> |
| 9 <script src="../resources/audit-util.js"></script> | 9 <script src="../resources/audit-util.js"></script> |
| 10 <script src="../resources/audit.js"></script> | 10 <script src="../resources/audit.js"></script> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // The first operation fails with an exception, thus the second one | 62 // The first operation fails with an exception, thus the second one |
| 63 // should not have effect on the parameter value. Instead, it should | 63 // should not have effect on the parameter value. Instead, it should |
| 64 // maintain the default value of 1.0. | 64 // maintain the default value of 1.0. |
| 65 should( | 65 should( |
| 66 function() { | 66 function() { |
| 67 amp1.gain.setValueAtTime(0.25, -1.0) | 67 amp1.gain.setValueAtTime(0.25, -1.0) |
| 68 .linearRampToValueAtTime(2.0, 1.0); | 68 .linearRampToValueAtTime(2.0, 1.0); |
| 69 }, | 69 }, |
| 70 'Calling setValueAtTime() with a negative end time') | 70 'Calling setValueAtTime() with a negative end time') |
| 71 .throw('InvalidAccessError'); | 71 .throw('RangeError'); |
| 72 | 72 |
| 73 // The first operation succeeds but the second fails due to zero target | 73 // The first operation succeeds but the second fails due to zero target |
| 74 // value for the exponential ramp. Thus only the first should have | 74 // value for the exponential ramp. Thus only the first should have |
| 75 // effect on the parameter value, setting the value to 0.5. | 75 // effect on the parameter value, setting the value to 0.5. |
| 76 should( | 76 should( |
| 77 function() { | 77 function() { |
| 78 amp2.gain.setValueAtTime(0.5, 0.0).exponentialRampToValueAtTime( | 78 amp2.gain.setValueAtTime(0.5, 0.0).exponentialRampToValueAtTime( |
| 79 0.0, 1.0); | 79 0.0, 1.0); |
| 80 }, | 80 }, |
| 81 'Calling exponentialRampToValueAtTime() with a zero target value') | 81 'Calling exponentialRampToValueAtTime() with a zero target value') |
| 82 .throw('InvalidAccessError'); | 82 .throw('RangeError'); |
| 83 | 83 |
| 84 osc.start(); | 84 osc.start(); |
| 85 osc.stop(1.0); | 85 osc.stop(1.0); |
| 86 | 86 |
| 87 context.startRendering() | 87 context.startRendering() |
| 88 .then(function(buffer) { | 88 .then(function(buffer) { |
| 89 should(amp1.gain.value, 'The gain value of the first gain node') | 89 should(amp1.gain.value, 'The gain value of the first gain node') |
| 90 .beEqualTo(1.0); | 90 .beEqualTo(1.0); |
| 91 should(amp2.gain.value, 'The gain value of the second gain node') | 91 should(amp2.gain.value, 'The gain value of the second gain node') |
| 92 .beEqualTo(0.5); | 92 .beEqualTo(0.5); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 .beCloseToArray( | 134 .beCloseToArray( |
| 135 expectedEnvelope, {absoluteThreshold: 4.0532e-6}); | 135 expectedEnvelope, {absoluteThreshold: 4.0532e-6}); |
| 136 }) | 136 }) |
| 137 .then(() => task.done()); | 137 .then(() => task.done()); |
| 138 }); | 138 }); |
| 139 | 139 |
| 140 audit.run(); | 140 audit.run(); |
| 141 </script> | 141 </script> |
| 142 </body> | 142 </body> |
| 143 </html> | 143 </html> |
| OLD | NEW |