Repository navigation
test: add coverage for DevTools embedder messages - #55938
dsanders11 merged 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NayLZkUudSeUBJhCBEjMmi Co-authored-by: Claude <[email protected]>
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]>
There was a problem hiding this comment.
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 inLoadNetworkResourcegets a bare{statusCode: 404},Reattachdetaches and reattaches the client and then always runs its callback, andOpenSearchResultsInNewTabgoes through the delegate to thedevtools-search-queryevent.devtools-open-urlanddevtools-search-queryare emitted inelectron_api_web_contents.cc. - spec/CLAUDE.md rules. The
devtools-closedlistener only sets a flag, the assertions use vitest matchers, temp dirs and theprotocol.handleregistration are cleaned up withdefer, andfreshDevToolsPartitionand 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.
|
No Release Notes |
Backport of #55932
See that PR for details.
Notes: none