Skip to content

test: fix webview window.opener spec for opener severing in #52472 - #52639

Merged
jkleinsc merged 1 commit into
mainfrom
spec-webview-opener-52472
Aug 5, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
spec-webview-opener-52472

Conversation

@claude

@claude claude Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by John Kleinschmidt · Slack thread

Description of Change

The spec chromium features window.opener.postMessage supports windows opened from a <webview> has been hard-failing on every main push since #52472 merged (notably the ASan shard, all 4 mocha attempts).

Before: the spec expected window.opener.postMessage to work for a window opened from a <webview>, but after #52472 the opener is severed whenever the child's sandbox state differs from the guest renderer process's launch-time sandbox state. That state could mismatch depending on which renderer process happened to host the guest (suite-order process reuse), so the spec's outcome was not deterministic.

After: the spec pins the guest's process state — an unsandboxed embedder (nodeIntegration: true, contextIsolation: false, webviewTag: true) lets the guest opt out of the sandbox via the nodeintegration attribute, and a dedicated partition guarantees a fresh renderer process whose launch-time sandbox record reflects the guest's own preferences — and the child explicitly matches it via setWindowOpenHandler with overrideBrowserWindowOptions: { webPreferences: { sandbox: false } }. With both sides pinned, the opener relationship — and the window.opener.postMessage assertion — is deterministic.

The opener-severing path itself (mismatched sandbox state) is covered for regular windows by the guest-window-manager-spec tests added in #52472. The now-unreferenced fixture spec/fixtures/pages/webview-opener-postMessage.html is removed.

Note: the test could not be exercised on CI yet due to the 2026-08-04 runner Python outage.

CI fix: the workflow fix for that outage (#52641, setting DEPOT_TOOLS_PYTHON_BYPASS: 1 in .github/workflows/pipeline-segment-electron-test.yml) has merged separately to main. This branch has been rebased onto it, so the test jobs can now exercise the spec fix here.

Checklist

Release Notes

Notes: no-notes


Generated by Claude Code

@claude
claude Bot force-pushed the spec-webview-opener-52472 branch from 76a903a to 789e285 Compare August 4, 2026 14:38
@claude claude Bot changed the title test: update webview window.opener spec for opener removal in #52472 test: update webview window.opener spec for opener severing in #52472 Aug 4, 2026
@claude
claude Bot force-pushed the spec-webview-opener-52472 branch from 789e285 to 90bd37d Compare August 4, 2026 14:57
@claude claude Bot changed the title test: update webview window.opener spec for opener severing in #52472 test: fix webview window.opener spec for opener severing in #52472 Aug 4, 2026
@claude
claude Bot marked this pull request as ready for review August 4, 2026 17:02
@ckerr ckerr added target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. no-backport and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 4, 2026
@claude
claude Bot force-pushed the spec-webview-opener-52472 branch from d44cf43 to 53eb3ac Compare August 5, 2026 01:39
@jkleinsc
jkleinsc merged commit 19d610b into main Aug 5, 2026
116 of 120 checks passed
@jkleinsc
jkleinsc deleted the spec-webview-opener-52472 branch August 5, 2026 15:29
@release-clerk

release-clerk Bot commented Aug 5, 2026

Copy link
Copy Markdown

No Release Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants