Skip to content

fix(browser): cast a page held by a dialog on macOS - #975

Merged
omartelo merged 5 commits into
mainfrom
fix/macos-held-dialog-pane
Oct 28, 2026
Merged

omartelo merged 5 commits into
mainfrom
fix/macos-held-dialog-pane

Conversation

@omartelo

@omartelo omartelo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes TestChromeAPaneOpenedOnADialogShowsThePage on macos-15-intel, which failed the v0.81.0 release job (run 40757293299).

Root cause

A product bug, not only a test bug. Up to Chrome 153, Page.startScreencast and Page.stopScreencast return FallThrough in content/browser/devtools/protocol/page_handler.cc, so Chrome answers them only once the renderer has seen them. A renderer holding a JavaScript dialog sees nothing until the dialog closes, although the browser has already started or stopped the frames. Chrome 154 answers both from the browser (Response::Success()). macos-15-intel ships Chrome 151 and macos-latest ships 155/156, which is why only the Intel release job failed.

The impact: with Chrome 153 or older, on any OS, opening the browser pane on a page holding a dialog waited the whole pageWait (30 s) in Attach, which then dropped the session's browser. A probe on the runner showed Page.stopScreencast blocked until the dialog was answered in 16 of 16 runs, while browser-level and browser-handled page commands answered in about 1 ms.

The test asserted what the contract promises and is unchanged.

Fix

  • chrome_view.go: screencast starts and stops run in order on a queue (castPastDialog) and return once done or once the page holds a dialog; the step runs on after that, and an error it meets later is logged. A stop is sent only while a screencast runs, so a pane opened on a held page starts its frames without a stop waiting first.
  • dialogs_test.go: a unit test with a step that blocks the way Chrome 151's reply does: the caller returns under the dialog and the steps run in order.
  • docs/ceilings.md: on Chrome 153 and older, a pane resized while a dialog is open keeps its last frame until the dialog is answered.

No CHANGELOG entry: dialogs ship in 0.81.0, which has not been released yet.

Measurement (GitHub runners, go test -v -count=N)

Runner Suite Before After (2 runs)
macos-15-intel, Chrome 151 pane test 3/20 failed 0/50, 0/50
macos-15-intel -run TestChrome 1 failure in 3 rounds 0/125, 0/125
macos-latest, Chrome 155/156 pane test 0/20 0/50, 0/50
macos-latest -run TestChrome 0/75 0/125, 0/125

Test plan

  • Local gate: gofmt -l ., go vet ./..., go test ./...
  • go test -race -count=200 -run TestAScreencastUnderADialog ./internal/browser/
  • macOS measurement above (temporary job removed in the last commit)

@omartelo
omartelo marked this pull request as ready for review October 28, 2026 21:21
@omartelo
omartelo force-pushed the fix/macos-held-dialog-pane branch from e4a4091 to 5af33e1 Compare October 28, 2026 21:21
@omartelo
omartelo merged commit 72d2661 into main Oct 28, 2026
9 of 10 checks passed
@omartelo
omartelo deleted the fix/macos-held-dialog-pane branch October 28, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant