Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9cc9590aec1f307806227eae156cee4a15b5bcc7
      
https://github.com/WebKit/WebKit/commit/9cc9590aec1f307806227eae156cee4a15b5bcc7
  Author: Chris Dumez <cdu...@apple.com>
  Date:   2025-09-03 (Wed, 03 Sep 2025)

  Changed paths:
    M 
LayoutTests/http/tests/navigation-api/form-submission-post-request-iframe.html
    M LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
    M Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/TestInvocation.cpp
    M Tools/WebKitTestRunner/TestInvocation.h

  Log Message:
  -----------
  REGRESSION(298480@main): [ macOS wk2 ] 
http/tests/navigation/ping-attribute/anchor-cookie.html is a flaky text failure.
https://bugs.webkit.org/show_bug.cgi?id=297428
rdar://158358934

Reviewed by Darin Adler.

* 
LayoutTests/http/tests/navigation-api/form-submission-post-request-iframe.html:
This test was scheduling a LOT more clicks than expected with EventSender. The 
reason
for this is that `iframe.onload` would get called again every time a click was 
made,
since it would cause the form to get submitted and thus the iframe to reload. 
We would
thus schedule 10 clicks per each frame load and each click would schedule its 
own frame
load. The crazy thing is that the test would "finish" after 10 clicks and the 
remaining
clicks would trigger on following tests, causing the flakiness. In the case of
anchor-cookie.html, it would click the link in the test too early, before the 
cookie
was set or before any existing ping was deleted.

* LayoutTests/http/tests/navigation/ping-attribute/resources/utilities.js:
(clearLastPingResultAndRunTest):
Revert change the delete-ping.py URL made in 299131@main as an attempt to fix
the flakiness. The URL was in fact correct and the XHR was merely failing 
because
it got aborted when the link was clicked unexpectedly, causing a navigation.

* LayoutTests/platform/mac-wk2/TestExpectations:
Unmark the test as flaky.

* Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::create):
(WTR::EventSendingController::createEventSenderDictionary):
(WTR::EventSendingController::createMouseMessageBody):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::asyncMouseDown):
(WTR::EventSendingController::asyncMouseUp):
(WTR::EventSendingController::asyncMouseMoveTo):
(WTR::EventSendingController::mouseForceClick):
(WTR::EventSendingController::startAndCancelMouseForceClick):
(WTR::EventSendingController::mouseForceDown):
(WTR::EventSendingController::mouseForceUp):
(WTR::EventSendingController::mouseForceChanged):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::scheduleAsynchronousClick):
(WTR::EventSendingController::createKeyDownMessageBody):
(WTR::EventSendingController::createRawKeyDownMessageBody):
(WTR::EventSendingController::createRawKeyUpMessageBody):
(WTR::EventSendingController::keyDown):
(WTR::EventSendingController::rawKeyDown):
(WTR::EventSendingController::rawKeyUp):
(WTR::EventSendingController::scheduleAsynchronousKeyDown):
(WTR::EventSendingController::mouseScrollBy):
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::setWheelHasPreciseDeltas):
(WTR::EventSendingController::continuousMouseScrollBy):
(WTR::EventSendingController::contextClick):
(WTR::EventSendingController::textZoomIn):
(WTR::EventSendingController::textZoomOut):
(WTR::EventSendingController::zoomPageIn):
(WTR::EventSendingController::zoomPageOut):
(WTR::EventSendingController::addTouchPoint):
(WTR::EventSendingController::updateTouchPoint):
(WTR::EventSendingController::setTouchModifier):
(WTR::EventSendingController::setTouchPointRadius):
(WTR::EventSendingController::touchStart):
(WTR::EventSendingController::touchMove):
(WTR::EventSendingController::touchEnd):
(WTR::EventSendingController::touchCancel):
(WTR::EventSendingController::clearTouchPoints):
(WTR::EventSendingController::releaseTouchPoint):
(WTR::EventSendingController::cancelTouchPoint):
(WTR::EventSendingController::smartMagnify):
(WTR::EventSendingController::scaleGestureStart):
(WTR::EventSendingController::scaleGestureChange):
(WTR::EventSendingController::scaleGestureEnd):
(): Deleted.
(WTR::createMouseMessageBody): Deleted.
(WTR::createKeyDownMessageBody): Deleted.
(WTR::createRawKeyDownMessageBody): Deleted.
(WTR::createRawKeyUpMessageBody): Deleted.
* Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didCreatePage):
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::beginTesting):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::testIdentifier const):
* Tools/WebKitTestRunner/TestController.cpp:
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):
(WTR::TestInvocation::createTestSettingsDictionary):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* Tools/WebKitTestRunner/TestInvocation.h:
Do hardening in WebKitTestRunner to prevent this sort of flakiness bug
in the future. In particular, each test invocation is now assigned an
identifier, which is passed to the injected bundle at the beginning
of each test. Whenever the injected bundle sends a EventSender IPC
message to the UIProces, it attaches this identifier. This allows the
UI process to filter out EventSender messages from previous tests
that may have been left over in the IPC pipe.
As an optimization, also disable the previous EventSendingController
instance when we start a new test and make sure it no longer attempts
to send any new IPC from then on. This IPC would be ignored by the
UIProcess now with my changes above but we may as well not send it.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to