ckerr

#54609: test: wait for the webview guest to load before navigating it

Merged
Created: Sep 30, 2026, 4:48:42 PM
Merged: Oct 6, 2026, 5:32:40 PM
4 comments
Target: main

Description of Change

Fixes a flaky webContents module setIgnoreMenuShortcuts(ignore) uses the source settings for webview spec, added in #54014.

The spec navigates the <webview> guest to about:blank right after did-attach-webview, but the guest may still be loading its src. If that load has committed but not finished, the navigation aborts it, and the aborted page's did-fail-load (ERR_ABORTED, with an empty description) settles the pending loadURL() promise. The spec then fails with Error: (-3) loading '…/spec/fixtures/pages/zoom-factor.html'.

Hitting that window depends on timing, so it shows up on slower runners. Downstream CI on hosted macOS x64 agents fails this spec on most attempts; upstream only runs api-web-contents.spec.ts on macOS x64 for pushes, not PRs.

The fix waits for the guest's initial load to finish before navigating it, using the same isLoading() / did-finish-load idiom already used elsewhere in the specs. This changes only the spec.

Validation on Linux (Testing build of main, under Xvfb):

  • The setIgnoreMenuShortcuts webview and docked DevTools specs pass.
  • Reproduced the CI error deterministically by serving the guest page slowly and delaying the navigation by 500ms to mimic a slow runner. Without this change the spec fails with (-3) loading '<guest url>'; with it, it passes.
  • tsc -p spec/tsconfig.json and JS lint pass.

Checklist

Release Notes

Notes: none

Backports

43-x-y
Merged
PR Number
#54674
Merged At
Oct 6, 2026, 8:51:15 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#54673
Merged At
Oct 6, 2026, 8:51:50 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54675
Merged At
Oct 6, 2026, 8:51:11 PM
Released In
Not yet
Release Date
Not yet

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