/*
* Lightweight helper named `expect`. It mirrors the audit.js helper but
* relies solely on testharness.js assertions.
*/
Is it possible to use the assertions directly? If not, we should remove references to audit.js in the comments because we will eventually remove this file.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
* Lightweight helper named `expect`. It mirrors the audit.js helper but
* relies solely on testharness.js assertions.
*/
Is it possible to use the assertions directly? If not, we should remove references to audit.js in the comments because we will eventually remove this file.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<title>Test k-rate AudioParams of PannerNode (direct assertions)</title>
I don't think we need to say "(direct assertions)" here.
doTest(context, should, {
The original test seems to create two PannerNodes, one at a-rate and one at k-rate, and then checks that they have different output. Please double-check the function `doTest` here:
https://crsrc.org/c/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioparam-interface/automation-rate-testing.js
I think we're missing the a-rate panner node in the new version.
numberOfChannels: 2,
Is there a reason for changing this from 3 to 2? Please see `doTest` for how the channels were used in the original test.
source.offset.value = 1;
This is the default value, I don't think we need to set it (or we can set it with the options object: https://webaudio.github.io/web-audio-api/#ConstantSourceOptions).
source.offset.value = 1;
This is the default value, I don't think we need to set it (or we can set it with the options object: https://webaudio.github.io/web-audio-api/#ConstantSourceOptions).
assert_all_close(
I think in this case they should actually be equal, not just close.
Let's also add back the comment "Verify that the output is constant over each render quantum"
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<title>Test k-rate AudioParams of PannerNode (direct assertions)</title>
I don't think we need to say "(direct assertions)" here.
Done
doTest(context, should, {
The original test seems to create two PannerNodes, one at a-rate and one at k-rate, and then checks that they have different output. Please double-check the function `doTest` here:
https://crsrc.org/c/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioparam-interface/automation-rate-testing.jsI think we're missing the a-rate panner node in the new version.
Done
Is there a reason for changing this from 3 to 2? Please see `doTest` for how the channels were used in the original test.
Done
This is the default value, I don't think we need to set it (or we can set it with the options object: https://webaudio.github.io/web-audio-api/#ConstantSourceOptions).
Done
This is the default value, I don't think we need to set it (or we can set it with the options object: https://webaudio.github.io/web-audio-api/#ConstantSourceOptions).
Done
I think in this case they should actually be equal, not just close.
Let's also add back the comment "Verify that the output is constant over each render quantum"
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (Math.abs(arr[i] - first) > Number.EPSILON) return; // varied → OK
Please add the curly bracket for the if statement also make the comment slightly complete.
e.g.
```
if (Math.abs(arr[i] - first) > Number.EPSILON) {
// If any element differs from the first by more than a negligible amount,
// the array is not constant, and the assertion passes.
return;
}
```
const K_RATE = 'k-rate';
const BLOCK = 128;
Consider adding comments to constants.
e.g.
```
// Represents the 'k-rate' AudioParam automation rate.
const K_RATE = 'k-rate';
// Defines the size of one audio processing block (render quantum) in frames.
const BLOCK = 128;
```
const sampleRate = 8000;
We could also add the SAMPLE_RATE constant if the same sample rate is used across the tests.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (Math.abs(arr[i] - first) > Number.EPSILON) return; // varied → OK
Please add the curly bracket for the if statement also make the comment slightly complete.
e.g.
```
if (Math.abs(arr[i] - first) > Number.EPSILON) {
// If any element differs from the first by more than a negligible amount,
// the array is not constant, and the assertion passes.
return;
}
```
Done
Consider adding comments to constants.
e.g.
```
// Represents the 'k-rate' AudioParam automation rate.
const K_RATE = 'k-rate';
// Defines the size of one audio processing block (render quantum) in frames.
const BLOCK = 128;
```
Done
We could also add the SAMPLE_RATE constant if the same sample rate is used across the tests.
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. |
Should this be `8000`?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<title> Test k-rate AudioParams of PannerNode </title>
Ditto
<title> Test k-rate AudioParams of PannerNode </title>
Remove ` `.
// If any element differs from the first by more than a negligible amount,
let's wrap it at 80 columns
// Defines the size of one audio processing block (render quantum) in frames.
Ditto: 80 columns.
`Panner ${param.name} k‑rate frames [${k}, ${k + slice.length - 1}]`);
Ditto: 80 columns.
listenerParams.forEach(p => {
Let's use `param` instead of `p`.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<title> Test k-rate AudioParams of PannerNode </title>
Punith NayakDitto
Done
<title> Test k-rate AudioParams of PannerNode </title>
Punith NayakRemove ` `.
Done
// If any element differs from the first by more than a negligible amount,
let's wrap it at 80 columns
Done
// Defines the size of one audio processing block (render quantum) in frames.
Punith NayakDitto: 80 columns.
Done
`Panner ${param.name} k‑rate frames [${k}, ${k + slice.length - 1}]`);
Punith NayakDitto: 80 columns.
Done
Let's use `param` instead of `p`.
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. |
Change-Id: I6004cd19223917566c43849cb969b9d0a8adb76d
```suggestion
Bug: 396477778
Change-Id: I6004cd19223917566c43849cb969b9d0a8adb76d
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
```suggestion
Bug: 396477778
Change-Id: I6004cd19223917566c43849cb969b9d0a8adb76d
```
Fix applied.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
10 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[webaudio] Migrate PannerNode and Listener k-rate tests to testharness.js
Replaces audit.js with testharness.js in k-rate automation tests for
PannerNode and AudioListener. Refactors assertions using testharness
primitives.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/53456
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |