Fix test browser.test_audio_worklet_direct to not be attempted on too old Firefox browser versions#26761
Conversation
… old Firefox browser versions where ES6 Module scripts are not supported.
| @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') |
There was a problem hiding this comment.
How is this different to the existing @requires_es6_workers?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Can you explain what you mean? Whats wrong with @requires_es6_workers here?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Hopefully this will all go away if we ever land #26677!
Fix test browser.test_audio_worklet_direct to not be attempted on too old Firefox browser versions where ES6 Module scripts are not supported.