Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2b5877a6cf7e7b4f80545b587561246082433129
      
https://github.com/WebKit/WebKit/commit/2b5877a6cf7e7b4f80545b587561246082433129
  Author: Ben Nham <[email protected]>
  Date:   2026-03-04 (Wed, 04 Mar 2026)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/mac/KeyboardEventTests.mm

  Log Message:
  -----------
  Fix flaky KeyboardEventTests.UserTextInputEvent test
https://bugs.webkit.org/show_bug.cgi?id=305665
rdar://168322007

Reviewed by Sihui Liu.

This test can be flaky for a couple of reasons:

1. At the time that `-objectByEvaluatingJavaScript:` returns from executing 
`focus()` from WebProcess,
   it's possible that the logic that updates the first responder in UIProcess 
still hasn't
   completed. Then, the subsequent call to `-typeCharacter:` ends up typing 
into nothing rather than
   typing into the text field. Work around this by inserting a 
`-waitForNextPresentationUpdate`.

2. When dispatching the fake input event, it's possible that 
`objectByEvaluatingJavaScript` spins
   the run loop enough to handle an alert before we execute 
`_test_waitForAlert`. Fix this by using
   a message handler rather than using `_test_waitForAlert`, which dynamically 
adds and removes a
   UIDelegate to the web view.

* Tools/TestWebKitAPI/Tests/mac/KeyboardEventTests.mm:
(TestWebKitAPI::TEST(KeyboardEventTests, UserTextInputEvent)):

Canonical link: https://commits.webkit.org/308682@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to