Skip to content

[test] Eliminate duplicate HTML shells in browser tests#27282

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:clean-up-duplicate-test-shells
Open

[test] Eliminate duplicate HTML shells in browser tests#27282
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:clean-up-duplicate-test-shells

Conversation

@sbc100

@sbc100 sbc100 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Remove 10 duplicate HTML shell files from the test suite and replace them with programmatic solutions.

  • Use --pre-js to dynamically configure canvas size, pre-initialize WebGL contexts, and pre-allocate heap on standard templates.
  • Monkey-patch Module.print/printErr in --pre-js to verify output without custom shells.
  • Dynamically inject interactive UI buttons in --pre-js.
  • Clone the canvas in --pre-js to strip default event listeners.
  • Dynamically generate static HTML assets in Python tests by modifying shell_minimal.html.
  • Update embind benchmark to inject styles via post-js.

This significantly reduces code duplication and ensures test shells don't drift from the main templates.

@sbc100 sbc100 force-pushed the clean-up-duplicate-test-shells branch 2 times, most recently from 61dc63a to eeb6aef Compare July 8, 2026 22:30
Remove 10 duplicate HTML shell files from the test suite and replace
them with programmatic solutions.

- Use --pre-js to dynamically configure canvas size, pre-initialize
  WebGL contexts, and pre-allocate heap on standard templates.
- Monkey-patch Module.print/printErr in --pre-js to verify output
  without custom shells.
- Dynamically inject interactive UI buttons in --pre-js.
- Clone the canvas in --pre-js to strip default event listeners.
- Dynamically generate static HTML assets in Python tests by modifying
  shell_minimal.html.
- Update embind benchmark to use default HTML shell.

This significantly reduces code duplication and ensures test shells
don't drift from the main templates.
@sbc100 sbc100 force-pushed the clean-up-duplicate-test-shells branch from eeb6aef to b096838 Compare July 8, 2026 22:35
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.

1 participant