Skip to content

Fix test browser.test_audio_worklet_direct to not be attempted on too old Firefox browser versions#26761

Merged
juj merged 2 commits intoemscripten-core:mainfrom
juj:fix_test_audio_worklet_direct_firefox
Apr 23, 2026
Merged

Fix test browser.test_audio_worklet_direct to not be attempted on too old Firefox browser versions#26761
juj merged 2 commits intoemscripten-core:mainfrom
juj:fix_test_audio_worklet_direct_firefox

Conversation

@juj
Copy link
Copy Markdown
Collaborator

@juj juj commented Apr 23, 2026

Fix test browser.test_audio_worklet_direct to not be attempted on too old Firefox browser versions where ES6 Module scripts are not supported.

… old Firefox browser versions where ES6 Module scripts are not supported.
Comment thread test/test_browser.py
@requires_shared_array_buffer
def test_audio_worklet(self, args):
if '-sEXPORT_ES6' in args and es6_module_workers_disabled():
self.skipTest('This test requires a browser with ES6 Module Workers support')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different to the existing @requires_es6_workers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, good catch. I intended to remove the @requires_es6_workers annotation. The annotation was too comprehensive, even though only few cases required it. Updated now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what you mean? Whats wrong with @requires_es6_workers here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding @requires_es6_workers would apply the ES6 Workers requirement over to all the variants:

  @parameterized({
    '': ([],),
    'with_fs': (['--preload-file', test_file('hello_world.c') + '@/'],),
    'closure': (['--closure', '1', '-Oz'],),
    'asyncify': (['-sASYNCIFY'],),
    'pthreads': (['-pthread', '-sPTHREAD_POOL_SIZE=2'],),
    'pthreads_and_closure': (['-pthread', '--closure', '1', '-Oz'],),
    'minimal_runtime': (['-sMINIMAL_RUNTIME'],),
    'minimal_runtime_pthreads_and_closure': (['-sMINIMAL_RUNTIME', '-pthread', '--closure', '1', '-Oz'],),
    'pthreads_es6': (['-pthread', '-sPTHREAD_POOL_SIZE=2', '-sEXPORT_ES6'],),
    'es6': (['-sEXPORT_ES6'],),
    'strict': (['-sSTRICT'],),
    'audio_params_disabled': (['-sAUDIO_WORKLET_SUPPORT_AUDIO_PARAMS=0'],),
  })

even though only pthreads_es6 and es6 require it. So that requirement would then skip testing coverage in any of the other cases on older Firefoxes that do support Audio Worklets, but did not support ES6 Module Workers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

For this type of case what I normally do is have an underlying self.require_es6_workers() that can then by used both in the decorator and locally within tests too. (note the singular require and then plural requires in the decorator name).

Its a shame that for decorators based on skipIfFeatureNotAvailable we don't have any easy way to use it in a non-decorator context today.

lgtm

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this will all go away if we ever land #26677!

@juj juj enabled auto-merge (squash) April 23, 2026 15:42
@juj juj disabled auto-merge April 23, 2026 18:05
@juj juj merged commit 7da8390 into emscripten-core:main Apr 23, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants