Skip to content

test: keep WebContentsView visibility specs' windows on top on Windows - #54727

Merged
jkleinsc merged 1 commit into
mainfrom
test/web-contents-view-visibility-on-top
Oct 8, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
test/web-contents-view-visibility-on-top

Conversation

@ckerr

@ckerr ckerr commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Keep the WebContentsView visibilityState specs' windows on top on Windows, and run the block serially.

These specs wait for their page to become 'visible'.
A BrowserWindow's own webContents is force-shown, but a BaseWindow's content views aren't, so Chromium's native occlusion tracker decides their visibility.
On the Windows CI hosts, another process's console window can sit above a newly shown test window, and under the parallel runner another worker's window can cover it.
Either way the page stays 'hidden' and waitUntil() times out.
Downstream CI on 42-x-y, 43-x-y and 44-x-y hits this in "tracks visibility for multiple child WebContentsViews", "tracks visibility independently when a child WebContentsView is hidden via setVisible" and "fires a single visibilitychange event per show/hide transition": waitUntil timed out after 10000ms, 30 failures each.

As #54334 did for visibility-state.spec.ts, this creates the block's BaseWindows always-on-top on Windows and tags the block serial.
Other platforms keep a normal window level.
Only test code changes.

Validation

Ran on a local Linux testing build of main under Xvfb:

  • e test --files spec/api-web-contents-view.spec.ts -g visibilityState: 9 passed in the serial phase, and 3 of 3 runs passed.
  • The Windows-only alwaysOnTop part isn't exercised on Linux.
  • script/lint.js --js and tsc -p tsconfig.spec.json pass.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

The WebContentsView visibilityState specs wait for their page to become
'visible'. A BrowserWindow's own webContents is force-shown, but a
BaseWindow's content views are not, so Chromium's native occlusion
tracker decides their visibility. On the Windows CI hosts another
process's console window can sit above a newly shown test window, and
under the parallel runner another worker's window can cover it, so the
page stays 'hidden' and waitUntil() times out.

As #54334 did for visibility-state.spec.ts, create these windows
always-on-top on Windows, and run the block serially.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ckerr ckerr added semver/none 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. target/45-x-y PR should also be added to the "45-x-y" branch. labels Oct 7, 2026

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an advantage to running these specs with the occlusion tracker enabled, they are testing visibility of the views wrt in app views and windows, not in reaction to external occlusion ?

@jkleinsc
jkleinsc merged commit 60984c4 into main Oct 8, 2026
107 checks passed
@release-clerk

release-clerk Bot commented Oct 8, 2026

Copy link
Copy Markdown

No Release Notes

@jkleinsc
jkleinsc deleted the test/web-contents-view-visibility-on-top branch October 8, 2026 13:55
@github-actions github-actions Bot added the 46-x-y label Oct 8, 2026
@trop

trop Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #54760

@trop

trop Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #54761

@trop trop Bot added the in-flight/43-x-y label Oct 8, 2026
@trop

trop Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #54762

@trop trop Bot added in-flight/45-x-y in-flight/44-x-y merged/44-x-y PR was merged to the "44-x-y" branch. and removed target/43-x-y PR should also be added to the "43-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. in-flight/44-x-y in-flight/43-x-y labels Oct 8, 2026
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Oct 8, 2026
@trop

trop Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "42-x-y", please check out #55120

ckerr added a commit that referenced this pull request Oct 19, 2026
…s (42-x-y) (#55120)

test: keep WebContentsView visibility specs' windows on top on Windows

Backport of #54727 to 42-x-y. Preserve the branch's Vitest assertions and existing BaseWindow options.

Co-authored-by: Copilot <[email protected]>
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants