Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d7de2afb3748cddbc80df70015643197a2e20ef2
https://github.com/WebKit/WebKit/commit/d7de2afb3748cddbc80df70015643197a2e20ef2
Author: Cole Carley <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebViewFindString.mm
Log Message:
-----------
WKWebViewFindString match index tests don't test what their names say
https://bugs.webkit.org/show_bug.cgi?id=325864
rdar://188858648
Reviewed by Zak Ridouh and Sammy Gill.
DoNotUpdateMatchIndexWhenGivenNoIndexChangeOption never reset isDone before its
second wait, so it read the match index left over from the first call. It also
never passed _WKFindOptionsDetermineMatchIndex, and NoIndexChange only has an
effect when that option is set. This patch Rewrites it to move the index to 1
with
DetermineMatchIndex, then check that a DetermineMatchIndex | NoIndexChange find
leaves the index at 1 while the selection moves to the third match.
MatchIndexDoesNotUpdateWithoutDetermineMatchIndexOption was a copy of
MatchIndexIsCorrectWhenNavigatingForwardAndBackward and passed
DetermineMatchIndex on every call. I changed its last find to use no options and
check that the index stays at 1.
Several tests also never reset the global isDone before their first wait. When
the file ran in a single process, those tests read the previous test's result
and ended up one callback behind.
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebViewFindString.mm:
(TestWebKitAPI::TEST(WKWebViewFindString,
DoNotFocusMatchWhenWebViewResignedAndHardwareKeyboardAttached)):
(TestWebKitAPI::TEST(WKWebViewFindString, DoNotFocusMatchWhenWebViewResigned)):
(TestWebKitAPI::TEST(WKWebViewFindString,
DoNotUpdateMatchIndexWhenGivenNoIndexChangeOption)):
(TestWebKitAPI::TEST(WKWebViewFindString,
MatchIndexIsCorrectWhenNavigatingForwardAndBackward)):
(TestWebKitAPI::TEST(WKWebViewFindString,
MatchIndexDoesNotUpdateWithoutDetermineMatchIndexOption)):
(TestWebKitAPI::TEST(WKWebViewFindString,
MatchIndexIsCorrectNavigatingWrapAround)):
(TestWebKitAPI::TEST(WKWebViewFindString,
MatchIndexIsCorrectNavigatingWrapAroundBackwards)):
(TestWebKitAPI::TEST(WKWebViewFindString,
MatchIndexResetsWhenSearchStringChanges)):
Canonical link: https://commits.webkit.org/322399@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications