#53956: test: gate specs on testing bindings
Merged
Description of Change
Add code to the specs to warn loudly if we try to run specs that require testing builds against release binaries of Electron.
The internalContextBridge test exposure and command-line fuse overrides depend on DCHECK_IS_ON(), as does electron_common_testing. Gate those suites with the existing testing-binding helper while retaining public context-bridge coverage. Allow callers to set ELECTRON_REQUIRE_TESTING_BINDINGS=1 to fail early if expected testing hooks are missing, preventing silent coverage loss in testing jobs. CI wiring for this opt-in flag is separate.
Validation
- Focused Node checks passed for suite selection with/without testing bindings and all six combinations of binding availability and the expectation flag (unset,
0,1). - Scoped oxlint, formatting, syntax, and whitespace checks passed.
- The exact patch applies cleanly to
45-x-y,44-x-y,43-x-y, and42-x-y; all have the required helpers. - Native Electron builds and the full spec suite were not run.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
Release Notes
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron