Looking good overall, please see other comments.
function assert_arrays_close(actual, expected, opts, desc) {
Can we adapt `assert_array_approx_equals` from testharness.js?
https://crsrc.org/c/third_party/blink/web_tests/resources/testharness.js;l=1712
// A really short time constant so that setTargetAtTime approaches the
// limiting value well before the end of the test.
Let's keep this comment too.
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 1, use a value of eps smaller than
// kSetTargetThreshold (1.5e-6) in AudioParamTimeline.cpp. This is to
// account for round-off in the actual implementation (which uses a
// filter and not the formula.)
Let's keep some form of this comment, maybe the below:
```
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 1, use a value of eps smaller than
// the target 1 threshold (1.5e-6). This is to
// account for round-off in the actual implementation (which uses a
// filter and not the formula.)
```
// Use the equation for setTargetAtTime to figure out when we are close
// to 0:
//
// v(t) = exp(-t/tau)
//
// So find t such that exp(-t/tau) <= eps. Thus t >= - tau * log(eps).
//
// For eps, use exp(-10).
Let's keep this comment.
// A really short time constant so that setTargetAtTime approaches the
// limiting value well before the end of the test.
Let's keep this comment.
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 0, use a value of eps smaller than
// kSetTargetZeroThreshold (1e-20) in AudioParamTimeline.cpp. This is
// to account for round-off in the actual implementation (which uses a
// filter and not the formula.)
I'd like to keep some form of this comment, but the values are outdated. Maybe the below:
```
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 0, use a value of eps smaller than
// the target zero threshold (1e-20). This is
// to account for round-off in the actual implementation (which uses a
// filter and not the formula.)
```
// Experimentally determined
Let's keep this comment.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
function assert_arrays_close(actual, expected, opts, desc) {
Can we adapt `assert_array_approx_equals` from testharness.js?
https://crsrc.org/c/third_party/blink/web_tests/resources/testharness.js;l=1712
Done
// A really short time constant so that setTargetAtTime approaches the
// limiting value well before the end of the test.
Let's keep this comment too.
Done
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 1, use a value of eps smaller than
// kSetTargetThreshold (1.5e-6) in AudioParamTimeline.cpp. This is to
// account for round-off in the actual implementation (which uses a
// filter and not the formula.)
Let's keep some form of this comment, maybe the below:
```
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 1, use a value of eps smaller than
// the target 1 threshold (1.5e-6). This is to
// account for round-off in the actual implementation (which uses a
// filter and not the formula.)
```
Done
// Use the equation for setTargetAtTime to figure out when we are close
// to 0:
//
// v(t) = exp(-t/tau)
//
// So find t such that exp(-t/tau) <= eps. Thus t >= - tau * log(eps).
//
// For eps, use exp(-10).
Let's keep this comment.
Done
// A really short time constant so that setTargetAtTime approaches the
// limiting value well before the end of the test.
Let's keep this comment.
Done
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 0, use a value of eps smaller than
// kSetTargetZeroThreshold (1e-20) in AudioParamTimeline.cpp. This is
// to account for round-off in the actual implementation (which uses a
// filter and not the formula.)
I'd like to keep some form of this comment, but the values are outdated. Maybe the below:
```
// Find the time where setTargetAtTime is close enough to the limit.
// Since we're approaching 0, use a value of eps smaller than
// the target zero threshold (1e-20). This is
// to account for round-off in the actual implementation (which uses a
// filter and not the formula.)
```
Done
// Experimentally determined
Let's keep this comment.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
// Use the equation for setTargetAtTime to figure out when we are close
// to 0:
//
// v(t) = exp(-t/tau)
//
// So find t such that exp(-t/tau) <= eps. Thus t >= - tau * log(eps).
//
// For eps, use exp(-10).
Nit: since this comment is talking about approaching zero, it might be in better context if it was moved before line 145.
let sampleRate = 48000;
Nit: since there is another variable with the same name in the last promise test, and since this value is only used twice, I think it might be more clear to put the value directly in the tests. But it's up to you.
sampleRate: sampleRate,
See other comment
```suggestion
sampleRate: 48000,
```
sampleRate: sampleRate,
See other comment
```suggestion
sampleRate: 48000,
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Use the equation for setTargetAtTime to figure out when we are close
// to 0:
//
// v(t) = exp(-t/tau)
//
// So find t such that exp(-t/tau) <= eps. Thus t >= - tau * log(eps).
//
// For eps, use exp(-10).
Nit: since this comment is talking about approaching zero, it might be in better context if it was moved before line 145.
Done
Nit: since there is another variable with the same name in the last promise test, and since this value is only used twice, I think it might be more clear to put the value directly in the tests. But it's up to you.
Done
See other comment
```suggestion
sampleRate: 48000,
```
Done
See other comment
```suggestion
sampleRate: 48000,
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
const msg = 'setTargetAtTime(' + options.v1 +
nit: let's avoid using abbreviation, use `message` instead.
const src = new ConstantSourceNode(context);
ditto: using `source` for source node.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
nit: let's avoid using abbreviation, use `message` instead.
Done
ditto: using `source` for source node.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[webaudio] Migrate setTargetAtTime limit test to testharness.js
Convert webaudio/audioparam/set-target-at-time-approach-limit.html
from the legacy audit.js runner to pure testharness.js
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |