-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] Add audio worklet parameter tests (and tidy other interactive tests) #23659
Conversation
a041945
to
0f5e291
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm in general, thanks for continuing to work on this.
This was actually a fun one to write! |
All review suggestions done:
|
This mostly adds an Audio Worklet parameter test, but also tidies a little the related tests and shared code.
0588d01
to
a55981e
Compare
All the audio tests in `test_browser.py` (except the mixer) were updated now the CI has audio, specifically: - Tests that require audio were flagged as so (tests that don't are documented) - Tests that currently fail for 2GB and wasm64 were flagged (only tests that play audio fail) - All tests were migrated to `btest_exit()` as previously discussed - (Tests moved `printf` calls to Emscripten's API and not stdio) - All tests were run manually and the audio output verified - All tests were run with `emscripten_force_exit` returning non-zero to verify they failed - All of this was also verified that they're running on a Debian VM without audio to manually check the console for `"Test success"` and other outputs for tests without `requires_sound_hardware` The mixer/AW struct test is a standalone PR in #23659. Fixes: #23131
} | ||
|
||
// This implementation has no custom start-up requirements | ||
EmscriptenStartWebAudioWorkletCallback getStartCallback(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be a function that returns a function? Why not just declare a function called startCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was because most tests return and use this default function in the shared code:
void initialised(EMSCRIPTEN_WEBAUDIO_T context, bool success, void* data) { |
Whereas one needed a custom implementation, so this was the cleanest way to keep most of the code shared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Cleanest way and still keeping it C)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comment
This is splits out the test changes from #23508 adding an interactive parameter test:
This test is also added to the browser tests now #23665 has merged, offering a single test that touches all the various structs and their offsets. When run as part of the
browser
tests it plays for 1 second, for interactive without theTEST_AND_EXIT
macro it will play continuously.It also tidies a little the shared code (and related tests) in the process. Interactive tests had
_2gb
and_4gb
options added (which will fail until #23508 lands, but they're not part of the CI). All features of these tests as interactive now work fully on Chrome, Firefox and Safari (Safari has issues with looping, but it doesn't affect the spirit of the test).