Skip to content

Add CefFindHandler binding (GH #32) - #51

Merged
Thrameos merged 1 commit into
masterfrom
backport/cef-find-handler
Sep 6, 2026
Merged

Thrameos merged 1 commit into
masterfrom
backport/cef-find-handler

Conversation

@Thrameos

@Thrameos Thrameos commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • find()/stopFinding() were fire-and-forget from Java: no way to observe when an in-page find settles, or to know it's safe to close/tear down a browser without a find request's mojo IPC still in flight.
  • Adds native/find_handler.{h,cpp} + org.cef.handler.CefFindHandler/CefFindHandlerAdapter, wired into client_handler.cpp/CefClient the same way every other handler type is (DragHandler is the closest existing pattern, using this branch's own GetHandler<T>() template).
  • Backport of coverage/phase1-value-objects-phase2-handlers' 135dc98, with JCEF_TRACE calls dropped (not on master) and a fresh, minimal CefFindHandlerTest.java instead of modifying the existing CefBrowserApiTest.java (which has diverged significantly on the future branch's coverage work).

Test plan

  • Full clean rebuild (fresh cmake reconfigure to pick up the new find_handler.cpp/.h sources, + ninja, + tools/compile.sh)
  • New CefFindHandlerTest exercises CefBrowser.find()/onFindResult() directly, bounded with assertTimeoutPreemptively(20s) rather than the usual blind TestFrame.awaitCompletion() -- this is the first test here exercising find()'s actual async round-trip, and a different CEF subsystem (CefDevToolsClient.executeDevToolsMethod()) is a confirmed unrecoverable hang in this environment (issue CefBrowser.getDevToolsClient()/executeDevToolsMethod() and browser.print() can hang indefinitely, unrecoverable #12), so this fails cleanly on a timeout instead of risking the whole suite
  • Test passes in ~2s (no hang)
  • CI (build/test/coverage jobs)

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq

find()/stopFinding() were fire-and-forget from Java: no way to observe
when an in-page find settles, or to know it's safe to close/tear down a
browser without a find request's mojo IPC still in flight.

Add native/find_handler.{h,cpp} + org.cef.handler.CefFindHandler, wired
into client_handler.cpp/CefClient the same way every other handler type
is (DragHandler is the closest existing pattern, using this branch's own
GetHandler<T>() template rather than the future branch's older direct-
lookup style).

Backport of coverage/phase1-value-objects-phase2-handlers' 135dc98,
with JCEF_TRACE calls dropped (not on master) and a fresh, minimal
CefFindHandlerTest.java instead of modifying the existing
CefBrowserApiTest.java (which has diverged significantly on the future
branch's coverage work) -- exercises CefBrowser.find()/onFindResult()
directly. Bounded with assertTimeoutPreemptively(20s) rather than the
usual blind TestFrame.awaitCompletion(): this is the first test here
exercising find()'s actual async round-trip, and CefDevToolsClient.
executeDevToolsMethod() (a different CEF subsystem) is a confirmed
unrecoverable hang in this environment (issue #12) -- fail cleanly on a
timeout rather than risk blocking the whole suite if find() turns out to
have a similar issue here.

Verified: full clean rebuild (native via a fresh cmake reconfigure to
pick up the new find_handler.cpp/.h sources, + Java), CefFindHandlerTest
passes in ~2s (no hang). A post-summary "Aborted (core dumped)" crash
after the JUnit run reported 0 failures is the already-tracked,
pre-existing GH #10 shutdown-race SIGSEGV, unrelated to this change.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
@Thrameos Thrameos added the enhancement New feature or request label Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.14925% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.17%. Comparing base (be68fe1) to head (1d79a2a).

Files with missing lines Patch % Lines
native/find_handler.cpp 53.84% 4 Missing and 8 partials ⚠️
java/org/cef/CefClient.java 60.00% 2 Missing and 2 partials ⚠️
java/org/cef/handler/CefClientHandler.java 60.00% 2 Missing ⚠️
java/org/cef/handler/CefFindHandlerAdapter.java 50.00% 1 Missing ⚠️
java/tests/junittests/CefFindHandlerTest.java 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #51      +/-   ##
============================================
+ Coverage     38.01%   38.17%   +0.16%     
- Complexity      735      741       +6     
============================================
  Files           243      246       +3     
  Lines         14863    14930      +67     
  Branches       2449     2460      +11     
============================================
+ Hits           5650     5700      +50     
- Misses         8011     8013       +2     
- Partials       1202     1217      +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thrameos
Thrameos merged commit 86cb9e4 into master Sep 6, 2026
9 checks passed
@Thrameos
Thrameos deleted the backport/cef-find-handler branch September 6, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant