Skip to content

test: add coverage for DevTools embedder messages - #55939

Merged
MarshallOfSound merged 3 commits into
44-x-yfrom
trop/44-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041817489
Nov 19, 2026
Merged

MarshallOfSound merged 3 commits into
44-x-yfrom
trop/44-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041817489

Conversation

@trop

@trop trop Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Backport of #55932

See that PR for details.

Notes: none

trop Bot and others added 2 commits November 18, 2026 22:43
The loadNetworkResource spec looked up the response header in lowercase,
but the embedder reports header names as the server sent them (the same
as Chrome's DevToolsUIBindings), so check the name the test server uses.

Also add one helper that builds DevTools frontend calls with JSON-escaped
arguments, one for indexing a path and waiting for it, and reuse the
match found while waiting for a frontend callback.

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

Co-authored-by: Claude <[email protected]>
@trop trop Bot mentioned this pull request Nov 18, 2026
6 tasks done
@trop trop Bot added 44-x-y backport This is a backport PR semver/none labels Nov 18, 2026
Comment thread spec/api-web-contents.spec.ts Resolved
Comment thread spec/api-web-contents.spec.ts Resolved
The backported DevTools embedder message specs use randomUUID and the
freshDevToolsPartition helper, which exist on main but not on this
release branch, so tsc and the specs failed with "Cannot find name".
Import randomUUID and add the helper.

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

@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. The latest push fixes both ReferenceErrors I raised earlier, and I found nothing new.

What was reviewed (from a standalone clone, with no Chromium tree available):

  • randomUUID is now imported from node:crypto (spec/api-web-contents.spec.ts:17). freshDevToolsPartition is now defined at module level (line 1816) and gives each preferences test its own persist: partition.
  • I checked the new helpers against spec/CLAUDE.md. No expect() runs inside an event listener (the devtools-closed listener only sets a flag). Temporary workspaces come from mkdtemp, and defer removes them. Request and stream ids start at 1,000,000, above the frontend's own.
  • I did not run the specs. Whether the DevTools frontend behaves as these tests expect is for CI to confirm.
Extended reasoning...

This backport only adds tests: 346 lines in spec/api-web-contents.spec.ts that exercise DevTools embedder messages (loadNetworkResource, openInNewTab, preferences, workspace search, reattach), with no production code changes. It touches no security-sensitive surface, and CODEOWNERS does not cover spec/. The previous review flagged two missing-symbol errors. The latest commit adds the node:crypto import and defines the partition helper, so both are fixed. Nothing else in the diff came up as a problem when I read it.

@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) November 19, 2026 04:41
@MarshallOfSound
MarshallOfSound merged commit f62a6c9 into 44-x-y Nov 19, 2026
68 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/44-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041817489 branch November 19, 2026 04:41
@release-clerk

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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants