Skip to content

Search the large text again when the WebView counts too early - #685

Merged
andiwand merged 1 commit into
mainfrom
search-again-when-the-webview-counts-early
Sep 24, 2026
Merged

andiwand merged 1 commit into
mainfrom
search-again-when-the-webview-counts-early

Conversation

@andiwand

@andiwand andiwand commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

LargeTextTests.aMegabyteOfTextOpensAndIsSearchable fails on API 26 (WebView 69) and API 30 (WebView 83) in some runs on main:

the search did not find every line expected:<6811> but was:<0>

The assertion before the search passes, so the DOM holds all 6811 lines. Then findAllAsync reports isDoneCounting=true with 0 matches, about one second after the page loads. The test does not time out.

I could not reproduce this locally, because no local AVD runs these WebView builds. Blink ends a search with a count of 0 when it thinks that the frame has no visible content, and this is my best guess for the cause, but I have not confirmed it.

Change

  • If the count is short, the test searches again for up to 5 seconds. It still requires every line to be found, and the time still counts against the 15-second budget.
  • The test logs a warning when a search needed more than one try, so the logcat shows how often this happens.
  • If the count never comes right, the failure message gives each count, isShown, the size, isAttachedToWindow and document.visibilityState.

This is independent of #684.

🤖 Generated with Claude Code

aMegabyteOfTextOpensAndIsSearchable fails on API 26 and API 30 in some
runs. The DOM holds every line, then findAllAsync reports a finished
count of 0 about one second later. WebView 69 and 83 do this, and a
search a moment later finds every line.

The test now searches again for up to 5 seconds while the count is
short, and logs how many tries it needed. If the count never comes
right, the failure gives each count and the state of the view, so the
next failure says more than "0".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Ph3Q6se1Ah28qfcunYHG7
@andiwand
andiwand force-pushed the search-again-when-the-webview-counts-early branch from f44845d to f8d9f6e Compare September 24, 2026 12:18
@andiwand
andiwand merged commit f9885c3 into main Sep 24, 2026
2 checks passed
@andiwand
andiwand deleted the search-again-when-the-webview-counts-early branch September 24, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant