Skip to content

test: add coverage for DevTools embedder messages - #55940

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

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

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 45-x-y backport This is a backport PR semver/none labels Nov 18, 2026
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 commit fixes the missing randomUUID import and freshDevToolsPartition helper I flagged before, and I found nothing else.

What was reviewed (from a standalone clone of the electron repo only):

  • Every identifier the new block uses is now defined or imported. That includes randomUUID, freshDevToolsPartition, waitUntil, defer, listen, closeAllWindows, url, os and WebContents.
  • Cleanup: each test closes its windows through afterEach(closeAllWindows). Temp workspaces, the file: URL test directory and the protocol.handle registration are all removed through defer. The http server is closed in afterAll.
  • spec/CLAUDE.md rules: the devtools-closed listener only sets a flag, which is checked later in the test body. Assertions use vitest matchers. The window-count check only covers windows in this process, so specs running in parallel don't affect it.
  • I didn't run the specs, so whether the DevTools frontend and embedder behave as these tests expect is left to CI.
Extended reasoning...

This is a test-only backport. It adds one 346-line describe block to spec/api-web-contents.spec.ts and changes no shipped code, so it touches no security-sensitive surface. The one issue raised earlier, ReferenceErrors from the missing randomUUID import and freshDevToolsPartition helper, is fixed in commit 2dd370d, and both are now defined. CODEOWNERS covers nothing under spec/. The timeline shows no other reviewer's objections.

@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) November 19, 2026 04:41
@MarshallOfSound
MarshallOfSound merged commit d11cdf4 into 45-x-y Nov 19, 2026
72 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041818483 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

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants