[webkit-changes] [WebKit/WebKit] bef4c7: [ iOS simulator ] 2X TestWebKitAPI.DragAndDropTest...

Abrar Rahman Protyasha noreply at github.com
Mon May 15 12:28:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bef4c7f2d0b60199d448ed763bc2edc554c55594
      https://github.com/WebKit/WebKit/commit/bef4c7f2d0b60199d448ed763bc2edc554c55594
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm
    M Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h
    A Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.mm
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.h
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

  Log Message:
  -----------
  [ iOS simulator ] 2X TestWebKitAPI.DragAndDropTests.ExternalSourceDataTransferItemGet (API-Tests) are constant timeouts
https://bugs.webkit.org/show_bug.cgi?id=256746
rdar://109222780

Reviewed by Wenson Hsieh.

The API tests TestWebKitAPI.DragAndDropTests.ExternalSourceDataTransferItemGet[Folder,PlainTextFile]AsEntry
consistently time out when running on an iOS simulator simulating iPhone
12. These timeouts have surfaced recently given we bumped the default
iPhone simulator to iPhone 12 in 256495 at main. When running on iPhone 12,
the change in screen resolution meant that some of our hardcoded drag
gestures became out-of-place, causing unwarranted behavior and leading
to the timeouts.

This commit hardens the test cases against similar changes in the future
by introducing a way to start a drag over an element in the DOM and
ending it at another element in the DOM. Doing so required imbibing
`TestWKWebView` with a `getElementMidpoint` method, which takes the
selector for a DOM element and returns its midpoint, and
`DragAndDropSimulator` with a `runFromElement:toElement:` method, which
is similar in spirit to the `runFrom:to:` except the drag source and
destination are now specified as DOM element selectors, rather than
locations.

* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.mm: Added.
(-[DragAndDropSimulator runFromElement:toElement:]):
* Tools/TestWebKitAPI/cocoa/TestWKWebView.h:
* Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView getElementMidpoint:]):

Signed-off-by: Abrar Rahman Protyasha <a_protyasha at apple.com>
Canonical link: https://commits.webkit.org/264080@main




More information about the webkit-changes mailing list