Skip to content

test: wait for navigation to settle in loadURL tests - #51642

Merged
ckerr merged 1 commit into
41-x-yfrom
trop/41-x-y-bp-test-wait-for-navigation-to-settle-in-loadurl-tests-1778857337363
May 15, 2026
Merged

ckerr merged 1 commit into
41-x-yfrom
trop/41-x-y-bp-test-wait-for-navigation-to-settle-in-loadurl-tests-1778857337363

Conversation

@trop

@trop trop Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Backport of #51579

See that PR for details.

Notes: none

The three reentrant loadURL tests could call done() while the primary
navigation was still in-flight. When the reentrant loadURL call is
rejected by the guard in WebContents::LoadURL(), it emits did-fail-load
synchronously. If the test exits on did-fail-load alone, the afterEach()
call to closeAllWindows() can destroy the window while that primary
navigation still has in-flight events.

Fix by using Promise.all() to wait for both did-fail-load and
did-stop-loading before the test exits, ensuring the primary navigation
has fully settled. The tests are also converted from done-callback style
to async/await for clarity.

Co-authored-by: GitHub Copilot <[email protected]>

Co-authored-by: Charles Kerr <[email protected]>
@trop
trop Bot requested a review from ckerr May 15, 2026 15:02
@trop trop Bot added 41-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels May 15, 2026
@ckerr
ckerr merged commit 500c134 into 41-x-y May 15, 2026
74 checks passed
@release-clerk

release-clerk Bot commented May 15, 2026

Copy link
Copy Markdown

No Release Notes

@ckerr
ckerr deleted the trop/41-x-y-bp-test-wait-for-navigation-to-settle-in-loadurl-tests-1778857337363 branch May 15, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

41-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant