Skip to content

Add test for native AudioWorklet.port and @requires_chrome_version - #27679

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:test-audioworklet-port
Sep 16, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:test-audioworklet-port

Conversation

@sbc100

@sbc100 sbc100 commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Add --enable-blink-features=AudioWorkletSharedPort to Chrome default flags to enable AudioWorklet.port (the spec-defined shared MessagePort between AudioWorklet and AudioWorkletGlobalScope).

Add get_chrome_version() in test/browser_common.py and requires_chrome_version in test/test_browser.py.

Add test/webaudio/test_audio_worklet_port.c and test test_audio_worklet_port to verify that when native AudioWorklet.port is present, the worklet uses it directly without falling back to the em-bootstrap AudioWorkletProcessor.

See: #27615

Add `--enable-blink-features=AudioWorkletSharedPort` to Chrome default
flags to enable `AudioWorklet.port` (the spec-defined shared
`MessagePort` between `AudioWorklet` and `AudioWorkletGlobalScope`).

Add `get_chrome_version()` in `test/browser_common.py` and
`requires_chrome_version` in `test/test_browser.py`.

Add `test/webaudio/test_audio_worklet_port.c` and test
`test_audio_worklet_port` to verify that when native `AudioWorklet.port`
is present, the worklet uses it directly without falling back to the
`em-bootstrap` `AudioWorkletProcessor`.

See: emscripten-core#27615
@sbc100
sbc100 force-pushed the test-audioworklet-port branch from 12a86f4 to 3bf6302 Compare September 15, 2026 17:26
@sbc100
sbc100 requested review from juj and kripken September 15, 2026 17:28
@sbc100
sbc100 enabled auto-merge (squash) September 15, 2026 20:13
Comment thread test/browser_common.py
# this flag for now: https://crbug.com/638180
'--no-first-run -start-maximized --no-sandbox --enable-unsafe-swiftshader --use-gl=swiftshader --enable-features=JavaScriptSourcePhaseImports',
'--enable-experimental-webassembly-features',
'--enable-blink-features=AudioWorkletSharedPort',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, do we want to enable such things for all tests? Can we enable it just for the one new test?

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.

We don't currently have any mechanism by which to do that. We re-uses the same browser process across tests, so they don't get their own argument.

We already do --enable-experimental-webassembly-features just above so there is precedent for doing this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, fair enough.

@sbc100
sbc100 merged commit 03c104f into emscripten-core:main Sep 16, 2026
42 checks passed
@sbc100
sbc100 deleted the test-audioworklet-port branch September 16, 2026 21:11
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