Skip to content

test: add coverage for DevTools embedder messages - #55938

Merged
dsanders11 merged 2 commits into
46-x-yfrom
trop/46-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041816487
Nov 19, 2026
Merged

dsanders11 merged 2 commits into
46-x-yfrom
trop/46-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041816487

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 46-x-y backport This is a backport PR semver/none labels Nov 18, 2026

@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 that adds DevTools embedder-message coverage, and it follows the patterns already used in this spec file. I reviewed it from a standalone clone (no Chromium tree).

What was reviewed:

  • The expectations against the Electron code they exercise. In shell/browser/ui/inspectable_web_contents.cc, an invalid URL in LoadNetworkResource gets a bare {statusCode: 404}, Reattach detaches and reattaches the client and then always runs its callback, and OpenSearchResultsInNewTab goes through the delegate to the devtools-search-query event. devtools-open-url and devtools-search-query are emitted in electron_api_web_contents.cc.
  • spec/CLAUDE.md rules. The devtools-closed listener only sets a flag, the assertions use vitest matchers, temp dirs and the protocol.handle registration are cleaned up with defer, and freshDevToolsPartition and the imports are in scope.
  • Focus and serial tagging. The suite opens detached DevTools with activate: false, the same way the existing untagged showItemInFolder suite does.

I did not run the specs, so timing behaviour on CI is unverified.

Extended reasoning...

The change adds one 340-line describe block to spec/api-web-contents.spec.ts and touches no production code. It changes no security-sensitive code: the tests only exercise existing DevTools embedder handlers from the DevTools frontend. No CODEOWNERS entry covers spec/. The PR timeline shows no prior reviews or objections. The bug hunt ended with exit reason dry_streak and no findings, and what the tests expect matches the handler code in inspectable_web_contents.cc.

@dsanders11
dsanders11 merged commit 43f5700 into 46-x-y Nov 19, 2026
91 checks passed
@dsanders11
dsanders11 deleted the trop/46-x-y-bp-test-add-coverage-for-devtools-embedder-messages-1795041816487 branch November 19, 2026 02:15
@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.

1 participant