Skip to content

test: cover webContents editing commands, device emulation and menu roles - #55925

Merged
jkleinsc merged 5 commits into
46-x-yfrom
trop/46-x-y-bp-test-cover-webcontents-editing-commands-device-emulation-and-menu-roles-1795025760059
Nov 18, 2026
Merged

jkleinsc merged 5 commits into
46-x-yfrom
trop/46-x-y-bp-test-cover-webcontents-editing-commands-device-emulation-and-menu-roles-1795025760059

Conversation

@trop

@trop trop Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Backport of #55903

See that PR for details.

Notes: none

trop Bot and others added 5 commits November 18, 2026 18:16
- Make sampleColor() report 'red' or 'green' only for a clearly red or
  green pixel, independent of BGRA/RGBA channel order, so an unpainted
  page no longer counts as a frame.
- Wait for the first frame before sampling the noAnimation case, and
  fail it only if the green frame is ever painted.
- Run setImageAnimationPolicy() serially since it captures the screen.
- Give the toggleDevTools() and worker inspection tests a fresh persisted
  partition each, so they never inherit an undocked dock state from the
  default session's Preferences and always dock into the hidden window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KX1hkNiiBq2fQEsXWusxpm

Co-authored-by: Claude <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. This is a test-only backport and I found nothing to fix. I reviewed it from a standalone clone, so none of the Chromium sources were available to me.

What I checked:

  • The suites that use the clipboard, focus, capturePage, fullscreen, visible windows or DevTools activation (menu edit roles, togglefullscreen, isDevToolsFocused, editing commands, setImageAnimationPolicy) are all tagged serial, as spec/CLAUDE.md requires. The suites left non-serial (toggleDevTools/inspect*Worker, which use a fresh persisted partition so DevTools open docked; device emulation; zoom; spellchecker) don't need OS focus or the clipboard.
  • Everything the new code uses exists on this branch: waitUntil, listen and setTimeout are imported, ClipboardItem is exported from lib/browser/api/module-list.ts, and executeByRole is defined. Windows are cleaned up by the existing afterEach(closeAllWindows) hooks. No expect() calls sit inside event listeners.
  • I did not run the specs, so I can't say whether the timing-sensitive waits (animated scroll, GIF frame sampling, device emulation) are flaky on CI.
Extended reasoning...

The change adds about 546 lines of vitest specs to spec/api-menu-item.spec.ts and spec/api-web-contents.spec.ts and touches no product code under shell/ or lib/. It touches nothing security-sensitive, and CODEOWNERS covers neither file. It is a bot backport of tests, and the APIs and helpers they use exist on this branch. The suites that need the system clipboard, focus or screen capture are tagged serial, as the repo's spec conventions require. Nothing is wrong beyond possible CI timing flakiness, which can only be judged by running the specs.

@jkleinsc
jkleinsc merged commit b44fc4d into 46-x-y Nov 18, 2026
91 checks passed
@jkleinsc
jkleinsc deleted the trop/46-x-y-bp-test-cover-webcontents-editing-commands-device-emulation-and-menu-roles-1795025760059 branch November 18, 2026 21:55
@release-clerk

release-clerk Bot commented Nov 18, 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

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants