ckerr

#55442: test: keep the HTML fullscreen spec's page drawing while covered

Merged
Created: Oct 28, 2026, 5:24:29 PM
Merged: Oct 29, 2026, 2:45:32 AM
5 comments
Target: main

Description of Change

BrowserWindow module > window states (excluding Linux) > fullscreen state > correctly remembers state prior to HTML fullscreen transition times out at 30 s on Windows arm64 CI, where a foreign topmost window can cover the test window. Chromium's native occlusion tracker then marks the covered page hidden.

Entering or leaving HTML fullscreen resizes the window before Electron updates the page's fullscreen state. Chromium holds that update back until the page has drawn a frame at the new size (visual_properties_ack_pending_). A hidden page doesn't draw, so requestFullscreen() or exitFullscreen() doesn't settle while the window is covered.

  • The spec now calls webContents.setBackgroundThrottling(false) after loading the page, so the page keeps drawing while covered.
    • Unlike the constructor option, which only stops later hides, the runtime call also shows a page that is already hidden. That happens when the window is covered after it is first shown but before the page commits.
    • The spec checks the menu bar state around the transition, not the page's visibility.
  • It focuses the page before each requestFullscreen(). Shortly after leaving fullscreen, Chromium refuses the request from an unfocused page, so the second iteration would fail with "not granted" if a foreign window had taken focus.
  • alwaysOnTop, which other specs use against covering console windows, wouldn't help here: on Windows it places the window below the taskbar's level, under a topmost window.

The spec only runs on Windows. To check the mechanism on Linux under Xvfb, I copied its flow into a throwaway spec and covered the window with another X client's window:

  • With the default options, requestFullscreen() stayed pending until the cover went away.
  • With the constructor option alone, it still stalled when the cover arrived before the page committed.
  • With the runtime call, it settled while still covered in both cases.

This PR also brings back the focusWebContents import that #55230 removed from this file.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

Backports

44-x-y
Merged
PR Number
#55471
Merged At
Oct 29, 2026, 9:01:55 AM
Released In
Not yet
Release Date
Not yet
45-x-y
In-flight
PR Number
#55470
Waiting to be merged
46-x-y
Merged
PR Number
#55469
Merged At
Oct 29, 2026, 9:02:13 AM
Released In
v46.0.0-alpha.3
Release Date
Oct 29, 2026, 3:00:25 PM

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