[iOS WK2] Rename and refactor DataInteractionTests and DataInteractionSimulator
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2018 19:02:21 +0000 (19:02 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2018 19:02:21 +0000 (19:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188439

Reviewed by Andy Estes and Megan Gardner.

Refactor DataInteractionSimulator (currently used for drag and drop testing on iOS) so that it exists across
macOS and iOS, and rename it to DragAndDropSimulator. Additionally, rename DataInteractionTests to
DragAndDropTests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: Renamed from Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm.
(testIconImage):
(testZIPArchive):
(-[UIItemProvider registerDataRepresentationForTypeIdentifier:withData:]):
(-[TestWKWebView editorContainsImageElement]):
(-[TestWKWebView editorValue]):
(makeCGRectValue):
(checkCGRectIsEqualToCGRectWithLogging):
(checkSelectionRectsWithLogging):
(checkRichTextTypePrecedesPlainTextType):
(checkFirstTypeIsPresentAndSecondTypeIsMissing):
(checkTypeIdentifierIsRegisteredAtIndex):
(checkEstimatedSize):
(checkSuggestedNameAndEstimatedSize):
(checkStringArraysAreEqual):
(checkDragCaretRectIsContainedInRect):
(checkJSONWithLogging):
(testIconImageData):
(runTestWithTemporaryTextFile):
(runTestWithTemporaryFolder):
(TestWebKitAPI::TEST):
(TestWebKitAPI::setUpTestWebViewForDataTransferItems):
(TestWebKitAPI::testDragAndDropOntoTargetElements):
(TestWebKitAPI::testIconImageData):
* TestWebKitAPI/cocoa/DragAndDropSimulator.h: Renamed from Tools/TestWebKitAPI/ios/DataInteractionSimulator.h.
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: Renamed from Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm.
(-[WKWebView dropInteractionDelegate]):
(-[WKWebView dragInteractionDelegate]):
(-[WKWebView dropInteraction]):
(-[WKWebView dragInteraction]):
(-[MockDragDropSession initWithItems:location:window:allowMove:]):
(-[MockDragDropSession allowsMoveOperation]):
(-[MockDragDropSession isRestrictedToDraggingApplication]):
(-[MockDragDropSession hasItemsConformingToTypeIdentifiers:]):
(-[MockDragDropSession canLoadObjectsOfClass:]):
(-[MockDragDropSession canLoadObjectsOfClasses:]):
(-[MockDragDropSession items]):
(-[MockDragDropSession setItems:]):
(-[MockDragDropSession addItems:]):
(-[MockDragDropSession locationInView:]):
(-[MockDropSession initWithProviders:location:window:allowMove:]):
(-[MockDropSession isLocal]):
(-[MockDropSession progress]):
(-[MockDropSession setProgressIndicatorStyle:]):
(-[MockDropSession progressIndicatorStyle]):
(-[MockDropSession operationMask]):
(-[MockDropSession localDragSession]):
(-[MockDropSession hasItemsConformingToTypeIdentifier:]):
(-[MockDropSession canCreateItemsOfClass:]):
(-[MockDropSession loadObjectsOfClass:completion:]):
(-[MockDragSession initWithWindow:allowMove:]):
(-[MockDragSession localOperationMask]):
(-[MockDragSession externalOperationMask]):
(-[MockDragSession session]):
(-[MockDragSession localContext]):
(-[MockDragSession setLocalContext:]):
(dragAndDropEventNames):
(-[DragAndDropSimulatorApplication _cancelAllTouches]):
(-[DragAndDropSimulator initWithWebView:]):
(-[DragAndDropSimulator dealloc]):
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator observedEventNames]):
(-[DragAndDropSimulator simulateAllTouchesCanceled:]):
(-[DragAndDropSimulator runFrom:to:]):
(-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
(-[DragAndDropSimulator finalSelectionRects]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator _enqueuePendingAdditionalItemRequestLocations]):
(-[DragAndDropSimulator _sendQueuedAdditionalItemRequest]):
(-[DragAndDropSimulator _advanceProgress]):
(-[DragAndDropSimulator _currentLocation]):
(-[DragAndDropSimulator _scheduleAdvanceProgress]):
(-[DragAndDropSimulator sourceItemProviders]):
(-[DragAndDropSimulator externalItemProviders]):
(-[DragAndDropSimulator setExternalItemProviders:]):
(-[DragAndDropSimulator phase]):
(-[DragAndDropSimulator liftPreviews]):
(-[DragAndDropSimulator lastKnownDragCaretRect]):
(-[DragAndDropSimulator waitForInputSession]):
(-[DragAndDropSimulator insertedAttachments]):
(-[DragAndDropSimulator removedAttachments]):
(-[DragAndDropSimulator endDataTransfer]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
(-[DragAndDropSimulator _webView:willUpdateDataInteractionOperationToOperation:forSession:]):
(-[DragAndDropSimulator _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:]):
(-[DragAndDropSimulator _webView:showCustomSheetForElement:]):
(-[DragAndDropSimulator _webView:willPerformDropWithSession:]):
(-[DragAndDropSimulator _webView:didInsertAttachment:]):
(-[DragAndDropSimulator _webView:didRemoveAttachment:]):
(-[DragAndDropSimulator _webView:focusShouldStartInputSession:]):
(-[DragAndDropSimulator _webView:didStartInputSession:]):
* TestWebKitAPI/ios/UIKitSPI.h:
* TestWebKitAPI/mac/DragAndDropSimulatorMac.mm: Added.
(-[DragAndDropSimulator initWithWebView:]):
(-[DragAndDropSimulator dealloc]):
(-[DragAndDropSimulator runFrom:to:]):
(-[DragAndDropSimulator insertedAttachments]):
(-[DragAndDropSimulator removedAttachments]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm [moved from Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm with 72% similarity]
Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h [moved from Tools/TestWebKitAPI/ios/DataInteractionSimulator.h with 54% similarity]
Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm [moved from Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm with 85% similarity]
Tools/TestWebKitAPI/ios/UIKitSPI.h
Tools/TestWebKitAPI/mac/DragAndDropSimulatorMac.mm [new file with mode: 0644]

index e15a6eb..149bda3 100644 (file)
@@ -1,3 +1,116 @@
+2018-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS WK2] Rename and refactor DataInteractionTests and DataInteractionSimulator
+        https://bugs.webkit.org/show_bug.cgi?id=188439
+
+        Reviewed by Andy Estes and Megan Gardner.
+
+        Refactor DataInteractionSimulator (currently used for drag and drop testing on iOS) so that it exists across
+        macOS and iOS, and rename it to DragAndDropSimulator. Additionally, rename DataInteractionTests to
+        DragAndDropTests.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: Renamed from Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm.
+        (testIconImage):
+        (testZIPArchive):
+        (-[UIItemProvider registerDataRepresentationForTypeIdentifier:withData:]):
+        (-[TestWKWebView editorContainsImageElement]):
+        (-[TestWKWebView editorValue]):
+        (makeCGRectValue):
+        (checkCGRectIsEqualToCGRectWithLogging):
+        (checkSelectionRectsWithLogging):
+        (checkRichTextTypePrecedesPlainTextType):
+        (checkFirstTypeIsPresentAndSecondTypeIsMissing):
+        (checkTypeIdentifierIsRegisteredAtIndex):
+        (checkEstimatedSize):
+        (checkSuggestedNameAndEstimatedSize):
+        (checkStringArraysAreEqual):
+        (checkDragCaretRectIsContainedInRect):
+        (checkJSONWithLogging):
+        (testIconImageData):
+        (runTestWithTemporaryTextFile):
+        (runTestWithTemporaryFolder):
+        (TestWebKitAPI::TEST):
+        (TestWebKitAPI::setUpTestWebViewForDataTransferItems):
+        (TestWebKitAPI::testDragAndDropOntoTargetElements):
+        (TestWebKitAPI::testIconImageData):
+        * TestWebKitAPI/cocoa/DragAndDropSimulator.h: Renamed from Tools/TestWebKitAPI/ios/DataInteractionSimulator.h.
+        * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: Renamed from Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm.
+        (-[WKWebView dropInteractionDelegate]):
+        (-[WKWebView dragInteractionDelegate]):
+        (-[WKWebView dropInteraction]):
+        (-[WKWebView dragInteraction]):
+        (-[MockDragDropSession initWithItems:location:window:allowMove:]):
+        (-[MockDragDropSession allowsMoveOperation]):
+        (-[MockDragDropSession isRestrictedToDraggingApplication]):
+        (-[MockDragDropSession hasItemsConformingToTypeIdentifiers:]):
+        (-[MockDragDropSession canLoadObjectsOfClass:]):
+        (-[MockDragDropSession canLoadObjectsOfClasses:]):
+        (-[MockDragDropSession items]):
+        (-[MockDragDropSession setItems:]):
+        (-[MockDragDropSession addItems:]):
+        (-[MockDragDropSession locationInView:]):
+        (-[MockDropSession initWithProviders:location:window:allowMove:]):
+        (-[MockDropSession isLocal]):
+        (-[MockDropSession progress]):
+        (-[MockDropSession setProgressIndicatorStyle:]):
+        (-[MockDropSession progressIndicatorStyle]):
+        (-[MockDropSession operationMask]):
+        (-[MockDropSession localDragSession]):
+        (-[MockDropSession hasItemsConformingToTypeIdentifier:]):
+        (-[MockDropSession canCreateItemsOfClass:]):
+        (-[MockDropSession loadObjectsOfClass:completion:]):
+        (-[MockDragSession initWithWindow:allowMove:]):
+        (-[MockDragSession localOperationMask]):
+        (-[MockDragSession externalOperationMask]):
+        (-[MockDragSession session]):
+        (-[MockDragSession localContext]):
+        (-[MockDragSession setLocalContext:]):
+        (dragAndDropEventNames):
+        (-[DragAndDropSimulatorApplication _cancelAllTouches]):
+        (-[DragAndDropSimulator initWithWebView:]):
+        (-[DragAndDropSimulator dealloc]):
+        (-[DragAndDropSimulator _resetSimulatedState]):
+        (-[DragAndDropSimulator observedEventNames]):
+        (-[DragAndDropSimulator simulateAllTouchesCanceled:]):
+        (-[DragAndDropSimulator runFrom:to:]):
+        (-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
+        (-[DragAndDropSimulator finalSelectionRects]):
+        (-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
+        (-[DragAndDropSimulator _enqueuePendingAdditionalItemRequestLocations]):
+        (-[DragAndDropSimulator _sendQueuedAdditionalItemRequest]):
+        (-[DragAndDropSimulator _advanceProgress]):
+        (-[DragAndDropSimulator _currentLocation]):
+        (-[DragAndDropSimulator _scheduleAdvanceProgress]):
+        (-[DragAndDropSimulator sourceItemProviders]):
+        (-[DragAndDropSimulator externalItemProviders]):
+        (-[DragAndDropSimulator setExternalItemProviders:]):
+        (-[DragAndDropSimulator phase]):
+        (-[DragAndDropSimulator liftPreviews]):
+        (-[DragAndDropSimulator lastKnownDragCaretRect]):
+        (-[DragAndDropSimulator waitForInputSession]):
+        (-[DragAndDropSimulator insertedAttachments]):
+        (-[DragAndDropSimulator removedAttachments]):
+        (-[DragAndDropSimulator endDataTransfer]):
+        (-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
+        (-[DragAndDropSimulator _webView:willUpdateDataInteractionOperationToOperation:forSession:]):
+        (-[DragAndDropSimulator _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:]):
+        (-[DragAndDropSimulator _webView:showCustomSheetForElement:]):
+        (-[DragAndDropSimulator _webView:willPerformDropWithSession:]):
+        (-[DragAndDropSimulator _webView:didInsertAttachment:]):
+        (-[DragAndDropSimulator _webView:didRemoveAttachment:]):
+        (-[DragAndDropSimulator _webView:focusShouldStartInputSession:]):
+        (-[DragAndDropSimulator _webView:didStartInputSession:]):
+        * TestWebKitAPI/ios/UIKitSPI.h:
+        * TestWebKitAPI/mac/DragAndDropSimulatorMac.mm: Added.
+        (-[DragAndDropSimulator initWithWebView:]):
+        (-[DragAndDropSimulator dealloc]):
+        (-[DragAndDropSimulator runFrom:to:]):
+        (-[DragAndDropSimulator insertedAttachments]):
+        (-[DragAndDropSimulator removedAttachments]):
+
 2018-08-09  Sihui Liu  <sihui_liu@apple.com>
 
         REGRESSION (r232083): WKWebView loses first-party cookies on iOS
index 3e036c3..432ab38 100644 (file)
                F45B63FE1F19D410009D38B9 /* ActionSheetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45B63FC1F19D410009D38B9 /* ActionSheetTests.mm */; };
                F45E15732112CE2900307E82 /* KeyboardInputTestsIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45E15722112CE2900307E82 /* KeyboardInputTestsIOS.mm */; };
                F45E15762112CE6200307E82 /* TestInputDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = F45E15752112CE6200307E82 /* TestInputDelegate.mm */; };
+               F46128B7211C8ED500D9FADB /* DragAndDropSimulatorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F46128B6211C8ED500D9FADB /* DragAndDropSimulatorMac.mm */; };
                F464AF9220BB66EA007F9B18 /* RenderingProgressTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F464AF9120BB66EA007F9B18 /* RenderingProgressTests.mm */; };
                F46849BE1EEF58E400B937FE /* UIPasteboardTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */; };
                F46849C01EEF5EF300B937FE /* rich-and-plain-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */; };
                F4CD74C620FDACFA00DE3794 /* text-with-async-script.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4CD74C520FDACF500DE3794 /* text-with-async-script.html */; };
                F4CD74C920FDB49600DE3794 /* TestURLSchemeHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */; };
                F4D2986E20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D2986D20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm */; };
-               F4D4F3B61E4E2BCB00BB2767 /* DataInteractionSimulator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D4F3B41E4E2BCB00BB2767 /* DataInteractionSimulator.mm */; };
-               F4D4F3B91E4E36E400BB2767 /* DataInteractionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D4F3B71E4E36E400BB2767 /* DataInteractionTests.mm */; };
+               F4D4F3B61E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */; };
+               F4D4F3B91E4E36E400BB2767 /* DragAndDropTestsIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D4F3B71E4E36E400BB2767 /* DragAndDropTestsIOS.mm */; };
                F4D5E4E81F0C5D38008C1A49 /* dragstart-clear-selection.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4D5E4E71F0C5D27008C1A49 /* dragstart-clear-selection.html */; };
                F4D65DA81F5E4704009D8C27 /* selected-text-image-link-and-editable.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */; };
                F4DEF6ED1E9B4DB60048EF61 /* image-in-link-and-input.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4DEF6EC1E9B4D950048EF61 /* image-in-link-and-input.html */; };
                F45E15722112CE2900307E82 /* KeyboardInputTestsIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyboardInputTestsIOS.mm; sourceTree = "<group>"; };
                F45E15742112CE6200307E82 /* TestInputDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestInputDelegate.h; sourceTree = "<group>"; };
                F45E15752112CE6200307E82 /* TestInputDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestInputDelegate.mm; sourceTree = "<group>"; };
+               F46128B4211C861A00D9FADB /* DragAndDropSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DragAndDropSimulator.h; path = cocoa/DragAndDropSimulator.h; sourceTree = "<group>"; };
+               F46128B6211C8ED500D9FADB /* DragAndDropSimulatorMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropSimulatorMac.mm; sourceTree = "<group>"; };
                F464AF9120BB66EA007F9B18 /* RenderingProgressTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderingProgressTests.mm; sourceTree = "<group>"; };
                F46849BD1EEF58E400B937FE /* UIPasteboardTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = UIPasteboardTests.mm; sourceTree = "<group>"; };
                F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "rich-and-plain-text.html"; sourceTree = "<group>"; };
                F4CD74C720FDB49600DE3794 /* TestURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestURLSchemeHandler.h; sourceTree = "<group>"; };
                F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestURLSchemeHandler.mm; sourceTree = "<group>"; };
                F4D2986D20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RunScriptAfterDocumentLoad.mm; sourceTree = "<group>"; };
-               F4D4F3B41E4E2BCB00BB2767 /* DataInteractionSimulator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataInteractionSimulator.mm; sourceTree = "<group>"; };
-               F4D4F3B51E4E2BCB00BB2767 /* DataInteractionSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataInteractionSimulator.h; sourceTree = "<group>"; };
-               F4D4F3B71E4E36E400BB2767 /* DataInteractionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataInteractionTests.mm; sourceTree = "<group>"; };
+               F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropSimulatorIOS.mm; sourceTree = "<group>"; };
+               F4D4F3B71E4E36E400BB2767 /* DragAndDropTestsIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropTestsIOS.mm; sourceTree = "<group>"; };
                F4D5E4E71F0C5D27008C1A49 /* dragstart-clear-selection.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "dragstart-clear-selection.html"; sourceTree = "<group>"; };
                F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "selected-text-image-link-and-editable.html"; sourceTree = "<group>"; };
                F4DEF6EC1E9B4D950048EF61 /* image-in-link-and-input.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "image-in-link-and-input.html"; sourceTree = "<group>"; };
                                A13EBB441B87332B00097110 /* WebProcessPlugIn */,
                                F4517B682054E0AC00C26721 /* ClassMethodSwizzler.h */,
                                F4517B692054E0AC00C26721 /* ClassMethodSwizzler.mm */,
+                               F46128B4211C861A00D9FADB /* DragAndDropSimulator.h */,
                                F44D06481F3962E3001A0E29 /* EditingTestHarness.h */,
                                F44D06491F3962E3001A0E29 /* EditingTestHarness.mm */,
                                5C726D6D1D3EE06800C5E1A1 /* InstanceMethodSwizzler.h */,
                2E9660DC16C07D7B00371B42 /* ios */ = {
                        isa = PBXGroup;
                        children = (
-                               F4D4F3B51E4E2BCB00BB2767 /* DataInteractionSimulator.h */,
-                               F4D4F3B41E4E2BCB00BB2767 /* DataInteractionSimulator.mm */,
+                               F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */,
                                2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */,
                                F4517B652054C49500C26721 /* TestWKWebViewController.h */,
                                F4517B662054C49500C26721 /* TestWKWebViewController.mm */,
                                A1C4FB6F1BACCEFA003742D0 /* Resources */,
                                2E205BA31F527746005952DD /* AccessibilityTestsIOS.mm */,
                                F45B63FC1F19D410009D38B9 /* ActionSheetTests.mm */,
-                               F4D4F3B71E4E36E400BB2767 /* DataInteractionTests.mm */,
+                               F4D4F3B71E4E36E400BB2767 /* DragAndDropTestsIOS.mm */,
                                F45E15722112CE2900307E82 /* KeyboardInputTestsIOS.mm */,
                                574F55CE204D3763002948C6 /* LocalAuthenticator.mm */,
                                7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */,
                BCA61C3A11700B9400460D1E /* mac */ = {
                        isa = PBXGroup;
                        children = (
+                               F46128B6211C8ED500D9FADB /* DragAndDropSimulatorMac.mm */,
                                1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */,
                                C081224013FC172400DC39AE /* JavaScriptTestMac.mm */,
                                2E7765CE16C4D81100BA2BB1 /* mainMac.mm */,
                                46A911592108E6780078D40D /* CustomUserAgent.mm in Sources */,
                                751B05D61F8EAC410028A09E /* DatabaseTrackerTest.mm in Sources */,
                                2DC4CF771D2D9DD800ECCC94 /* DataDetection.mm in Sources */,
-                               F4D4F3B61E4E2BCB00BB2767 /* DataInteractionSimulator.mm in Sources */,
-                               F4D4F3B91E4E36E400BB2767 /* DataInteractionTests.mm in Sources */,
                                518EE51D20A78D3600E024F3 /* DecidePolicyForNavigationAction.mm in Sources */,
                                2D1646E21D1862CD00015A1A /* DeferredViewInWindowStateChange.mm in Sources */,
                                7CCE7EB91A411A7E00447C4C /* DeviceScaleFactorInDashboardRegions.mm in Sources */,
                                7CCE7F231A411AF600447C4C /* Download.mm in Sources */,
                                7CCE7EEE1A411AE600447C4C /* DownloadDecideDestinationCrash.cpp in Sources */,
                                F4BFA68E1E4AD08000154298 /* DragAndDropPasteboardTests.mm in Sources */,
+                               F4D4F3B61E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm in Sources */,
+                               F46128B7211C8ED500D9FADB /* DragAndDropSimulatorMac.mm in Sources */,
+                               F4D4F3B91E4E36E400BB2767 /* DragAndDropTestsIOS.mm in Sources */,
                                A155022A1E05020B00A24C57 /* DuplicateCompletionHandlerCalls.mm in Sources */,
                                7CCE7EBE1A411A7E00447C4C /* DynamicDeviceScaleFactor.mm in Sources */,
                                5C0BF8921DD599B600B00328 /* EarlyKVOCrash.mm in Sources */,
index 4689da4..d8f56bd 100644 (file)
@@ -25,7 +25,7 @@
 
 #import "config.h"
 
-#import "DataInteractionSimulator.h"
+#import "DragAndDropSimulator.h"
 #import "PlatformUtilities.h"
 #import "TestWKWebView.h"
 #import "WKWebViewConfigurationExtras.h"
@@ -1194,15 +1194,15 @@ TEST(WKAttachmentTestsMac, InsertPastedFileURLsAsAttachments)
 TEST(WKAttachmentTestsIOS, InsertDroppedImageAsAttachment)
 {
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto item = adoptNS([[NSItemProvider alloc] init]);
     [item registerData:testImageData() type:(NSString *)kUTTypePNG];
-    [draggingSimulator setExternalItemProviders:@[ item.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    [dragAndDropSimulator setExternalItemProviders:@[ item.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
-    EXPECT_EQ(1U, [draggingSimulator insertedAttachments].count);
-    EXPECT_EQ(0U, [draggingSimulator removedAttachments].count);
-    auto attachment = retainPtr([draggingSimulator insertedAttachments].firstObject);
+    EXPECT_EQ(1U, [dragAndDropSimulator insertedAttachments].count);
+    EXPECT_EQ(0U, [dragAndDropSimulator removedAttachments].count);
+    auto attachment = retainPtr([dragAndDropSimulator insertedAttachments].firstObject);
     [attachment expectRequestedDataToBe:testImageData()];
     EXPECT_WK_STREQ("public.png", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
@@ -1217,17 +1217,17 @@ TEST(WKAttachmentTestsIOS, InsertDroppedImageAsAttachment)
 TEST(WKAttachmentTestsIOS, InsertDroppedAttributedStringContainingAttachment)
 {
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto image = adoptNS([[NSTextAttachment alloc] initWithData:testImageData() ofType:(NSString *)kUTTypePNG]);
     auto item = adoptNS([[NSItemProvider alloc] init]);
     [item registerObject:[NSAttributedString attributedStringWithAttachment:image.get()] visibility:NSItemProviderRepresentationVisibilityAll];
 
-    [draggingSimulator setExternalItemProviders:@[ item.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    [dragAndDropSimulator setExternalItemProviders:@[ item.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
-    EXPECT_EQ(1U, [draggingSimulator insertedAttachments].count);
-    EXPECT_EQ(0U, [draggingSimulator removedAttachments].count);
-    auto attachment = retainPtr([draggingSimulator insertedAttachments].firstObject);
+    EXPECT_EQ(1U, [dragAndDropSimulator insertedAttachments].count);
+    EXPECT_EQ(0U, [dragAndDropSimulator removedAttachments].count);
+    auto attachment = retainPtr([dragAndDropSimulator insertedAttachments].firstObject);
 
     auto size = platformImageWithData([attachment synchronouslyRequestData:nil]).size;
     EXPECT_EQ(215., size.width);
@@ -1260,14 +1260,14 @@ TEST(WKAttachmentTestsIOS, InsertDroppedRichAndPlainTextFilesAsAttachments)
     [plainTextItem setSuggestedName:@"world.txt"];
 
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator setExternalItemProviders:@[ richTextItem.get(), plainTextItem.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator setExternalItemProviders:@[ richTextItem.get(), plainTextItem.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
-    EXPECT_EQ(2U, [draggingSimulator insertedAttachments].count);
-    EXPECT_EQ(0U, [draggingSimulator removedAttachments].count);
+    EXPECT_EQ(2U, [dragAndDropSimulator insertedAttachments].count);
+    EXPECT_EQ(0U, [dragAndDropSimulator removedAttachments].count);
 
-    for (_WKAttachment *attachment in [draggingSimulator insertedAttachments]) {
+    for (_WKAttachment *attachment in [dragAndDropSimulator insertedAttachments]) {
         NSError *error = nil;
         EXPECT_GT([attachment synchronouslyRequestData:&error].length, 0U);
         EXPECT_TRUE(!error);
@@ -1293,13 +1293,13 @@ TEST(WKAttachmentTestsIOS, InsertDroppedZipArchiveAsAttachment)
     [item setSuggestedName:@"archive.zip"];
 
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator setExternalItemProviders:@[ item.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator setExternalItemProviders:@[ item.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
-    EXPECT_EQ(1U, [draggingSimulator insertedAttachments].count);
-    EXPECT_EQ(0U, [draggingSimulator removedAttachments].count);
-    [[draggingSimulator insertedAttachments].firstObject expectRequestedDataToBe:data];
+    EXPECT_EQ(1U, [dragAndDropSimulator insertedAttachments].count);
+    EXPECT_EQ(0U, [dragAndDropSimulator removedAttachments].count);
+    [[dragAndDropSimulator insertedAttachments].firstObject expectRequestedDataToBe:data];
     EXPECT_EQ(1, [webView stringByEvaluatingJavaScript:@"document.querySelectorAll('attachment').length"].intValue);
     EXPECT_WK_STREQ("archive.zip", [webView valueOfAttribute:@"title" forQuerySelector:@"attachment"]);
     EXPECT_WK_STREQ("application/zip", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
@@ -1323,14 +1323,14 @@ TEST(WKAttachmentTestsIOS, InsertDroppedItemProvidersInOrder)
     [secondAttachmentItem setSuggestedName:@"second.pdf"];
 
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator setExternalItemProviders:@[ firstAttachmentItem.get(), inlineTextItem.get(), secondAttachmentItem.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator setExternalItemProviders:@[ firstAttachmentItem.get(), inlineTextItem.get(), secondAttachmentItem.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
-    EXPECT_EQ(2U, [draggingSimulator insertedAttachments].count);
-    EXPECT_EQ(0U, [draggingSimulator removedAttachments].count);
+    EXPECT_EQ(2U, [dragAndDropSimulator insertedAttachments].count);
+    EXPECT_EQ(0U, [dragAndDropSimulator removedAttachments].count);
 
-    for (_WKAttachment *attachment in [draggingSimulator insertedAttachments]) {
+    for (_WKAttachment *attachment in [dragAndDropSimulator insertedAttachments]) {
         NSError *error = nil;
         EXPECT_GT([attachment synchronouslyRequestData:&error].length, 0U);
         EXPECT_TRUE(!error);
@@ -1355,28 +1355,28 @@ TEST(WKAttachmentTestsIOS, DragAttachmentInsertedAsFile)
     [item setSuggestedName:@"document.pdf"];
 
     auto webView = webViewForTestingAttachments();
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator setExternalItemProviders:@[ item.get() ]];
-    [draggingSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator setExternalItemProviders:@[ item.get() ]];
+    [dragAndDropSimulator runFrom:CGPointZero to:CGPointMake(50, 50)];
 
     // First, verify that the attachment was successfully dropped.
-    EXPECT_EQ(1U, [draggingSimulator insertedAttachments].count);
-    _WKAttachment *attachment = [draggingSimulator insertedAttachments].firstObject;
+    EXPECT_EQ(1U, [dragAndDropSimulator insertedAttachments].count);
+    _WKAttachment *attachment = [dragAndDropSimulator insertedAttachments].firstObject;
     [attachment expectRequestedDataToBe:data.get()];
     EXPECT_WK_STREQ("document.pdf", [webView valueOfAttribute:@"title" forQuerySelector:@"attachment"]);
     EXPECT_WK_STREQ("application/pdf", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
     [webView evaluateJavaScript:@"getSelection().removeAllRanges()" completionHandler:nil];
-    [draggingSimulator setExternalItemProviders:@[ ]];
-    [draggingSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
+    [dragAndDropSimulator setExternalItemProviders:@[ ]];
+    [dragAndDropSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
 
     // Next, verify that dragging the attachment produces an item provider with a PDF attachment.
-    EXPECT_EQ(1U, [draggingSimulator sourceItemProviders].count);
-    NSItemProvider *itemProvider = [draggingSimulator sourceItemProviders].firstObject;
+    EXPECT_EQ(1U, [dragAndDropSimulator sourceItemProviders].count);
+    NSItemProvider *itemProvider = [dragAndDropSimulator sourceItemProviders].firstObject;
     EXPECT_EQ(UIPreferredPresentationStyleAttachment, itemProvider.preferredPresentationStyle);
     [itemProvider expectType:(NSString *)kUTTypePDF withData:data.get()];
     EXPECT_WK_STREQ("document.pdf", [itemProvider suggestedName]);
-    [draggingSimulator endDataTransfer];
+    [dragAndDropSimulator endDataTransfer];
 }
 
 TEST(WKAttachmentTestsIOS, DragAttachmentInsertedAsData)
@@ -1396,16 +1396,16 @@ TEST(WKAttachmentTestsIOS, DragAttachmentInsertedAsData)
     EXPECT_WK_STREQ("application/pdf", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
     [webView evaluateJavaScript:@"getSelection().removeAllRanges()" completionHandler:nil];
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
 
     // Next, verify that dragging the attachment produces an item provider with a PDF attachment.
-    EXPECT_EQ(1U, [draggingSimulator sourceItemProviders].count);
-    NSItemProvider *itemProvider = [draggingSimulator sourceItemProviders].firstObject;
+    EXPECT_EQ(1U, [dragAndDropSimulator sourceItemProviders].count);
+    NSItemProvider *itemProvider = [dragAndDropSimulator sourceItemProviders].firstObject;
     EXPECT_EQ(UIPreferredPresentationStyleAttachment, itemProvider.preferredPresentationStyle);
     [itemProvider expectType:(NSString *)kUTTypePDF withData:data.get()];
     EXPECT_WK_STREQ("document.pdf", [itemProvider suggestedName]);
-    [draggingSimulator endDataTransfer];
+    [dragAndDropSimulator endDataTransfer];
 }
 
 TEST(WKAttachmentTestsIOS, DragInPlaceVideoAttachmentElement)
@@ -1425,15 +1425,15 @@ TEST(WKAttachmentTestsIOS, DragInPlaceVideoAttachmentElement)
     EXPECT_WK_STREQ("video/mp4", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
     [webView evaluateJavaScript:@"getSelection().removeAllRanges()" completionHandler:nil];
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(-100, -100)];
 
-    EXPECT_EQ(1U, [draggingSimulator sourceItemProviders].count);
-    NSItemProvider *itemProvider = [draggingSimulator sourceItemProviders].firstObject;
+    EXPECT_EQ(1U, [dragAndDropSimulator sourceItemProviders].count);
+    NSItemProvider *itemProvider = [dragAndDropSimulator sourceItemProviders].firstObject;
     EXPECT_EQ(UIPreferredPresentationStyleAttachment, itemProvider.preferredPresentationStyle);
     [itemProvider expectType:(NSString *)kUTTypeMPEG4 withData:data.get()];
     EXPECT_WK_STREQ("video.mp4", [itemProvider suggestedName]);
-    [draggingSimulator endDataTransfer];
+    [dragAndDropSimulator endDataTransfer];
 }
 
 TEST(WKAttachmentTestsIOS, MoveAttachmentElementAsIconByDragging)
@@ -1452,16 +1452,16 @@ TEST(WKAttachmentTestsIOS, MoveAttachmentElementAsIconByDragging)
     [webView _synchronouslyExecuteEditCommand:@"InsertParagraph" argument:nil];
     [webView expectElementTag:@"ATTACHMENT" toComeBefore:@"STRONG"];
 
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(25, 425)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(25, 425)];
 
-    attachment = [[draggingSimulator insertedAttachments] firstObject];
+    attachment = [[dragAndDropSimulator insertedAttachments] firstObject];
     [attachment expectRequestedDataToBe:data.get()];
     EXPECT_WK_STREQ("document.pdf", [webView valueOfAttribute:@"title" forQuerySelector:@"attachment"]);
     EXPECT_WK_STREQ("application/pdf", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
     [webView expectElementTag:@"STRONG" toComeBefore:@"ATTACHMENT"];
-    [draggingSimulator endDataTransfer];
+    [dragAndDropSimulator endDataTransfer];
 }
 
 TEST(WKAttachmentTestsIOS, MoveInPlaceAttachmentElementByDragging)
@@ -1481,16 +1481,16 @@ TEST(WKAttachmentTestsIOS, MoveInPlaceAttachmentElementByDragging)
     [webView _synchronouslyExecuteEditCommand:@"InsertParagraph" argument:nil];
     [webView expectElementTag:@"ATTACHMENT" toComeBefore:@"STRONG"];
 
-    auto draggingSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [draggingSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(25, 425)];
+    auto dragAndDropSimulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [dragAndDropSimulator runFrom:CGPointMake(25, 25) to:CGPointMake(25, 425)];
 
-    attachment = [[draggingSimulator insertedAttachments] firstObject];
+    attachment = [[dragAndDropSimulator insertedAttachments] firstObject];
     [attachment expectRequestedDataToBe:data.get()];
     EXPECT_WK_STREQ("icon.png", [webView valueOfAttribute:@"title" forQuerySelector:@"attachment"]);
     EXPECT_WK_STREQ("image/png", [webView valueOfAttribute:@"type" forQuerySelector:@"attachment"]);
 
     [webView expectElementTag:@"STRONG" toComeBefore:@"ATTACHMENT"];
-    [draggingSimulator endDataTransfer];
+    [dragAndDropSimulator endDataTransfer];
 }
 
 #endif // PLATFORM(IOS)
@@ -25,9 +25,9 @@
 
 #include "config.h"
 
-#if ENABLE(DATA_INTERACTION)
+#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS) && WK_API_ENABLED
 
-#import "DataInteractionSimulator.h"
+#import "DragAndDropSimulator.h"
 #import "PlatformUtilities.h"
 #import "TestWKWebView.h"
 #import "UIKitSPI.h"
@@ -71,7 +71,7 @@ static NSData *testZIPArchive()
     return [NSData dataWithContentsOfURL:zipFileURL];
 }
 
-@implementation UIItemProvider (DataInteractionTests)
+@implementation UIItemProvider (DragAndDropTests)
 
 - (void)registerDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier withData:(NSData *)data
 {
@@ -84,7 +84,7 @@ static NSData *testZIPArchive()
 
 @end
 
-@implementation TestWKWebView (DataInteractionTests)
+@implementation TestWKWebView (DragAndDropTests)
 
 - (BOOL)editorContainsImageElement
 {
@@ -118,7 +118,7 @@ static void checkSelectionRectsWithLogging(NSArray *expected, NSArray *observed)
     EXPECT_TRUE([expected isEqualToArray:observed]);
 }
 
-static void checkRichTextTypePrecedesPlainTextType(DataInteractionSimulator *simulator)
+static void checkRichTextTypePrecedesPlainTextType(DragAndDropSimulator *simulator)
 {
     // At least one of "com.apple.flat-rtfd" or "public.rtf" is expected to have higher precedence than "public.utf8-plain-text".
     NSArray *registeredTypes = [simulator.sourceItemProviders.firstObject registeredTypeIdentifiers];
@@ -129,28 +129,28 @@ static void checkRichTextTypePrecedesPlainTextType(DataInteractionSimulator *sim
     EXPECT_TRUE((indexOfRTFType != NSNotFound && indexOfRTFType < indexOfPlainTextType) || (indexOfFlatRTFDType != NSNotFound && indexOfFlatRTFDType < indexOfPlainTextType));
 }
 
-static void checkFirstTypeIsPresentAndSecondTypeIsMissing(DataInteractionSimulator *simulator, CFStringRef firstType, CFStringRef secondType)
+static void checkFirstTypeIsPresentAndSecondTypeIsMissing(DragAndDropSimulator *simulator, CFStringRef firstType, CFStringRef secondType)
 {
     NSArray *registeredTypes = [simulator.sourceItemProviders.firstObject registeredTypeIdentifiers];
     EXPECT_TRUE([registeredTypes containsObject:(NSString *)firstType]);
     EXPECT_FALSE([registeredTypes containsObject:(NSString *)secondType]);
 }
 
-static void checkTypeIdentifierIsRegisteredAtIndex(DataInteractionSimulator *simulator, NSString *type, NSUInteger index)
+static void checkTypeIdentifierIsRegisteredAtIndex(DragAndDropSimulator *simulator, NSString *type, NSUInteger index)
 {
     NSArray *registeredTypes = [simulator.sourceItemProviders.firstObject registeredTypeIdentifiers];
     EXPECT_GT(registeredTypes.count, index);
     EXPECT_WK_STREQ(type.UTF8String, [registeredTypes[index] UTF8String]);
 }
 
-static void checkEstimatedSize(DataInteractionSimulator *simulator, CGSize estimatedSize)
+static void checkEstimatedSize(DragAndDropSimulator *simulator, CGSize estimatedSize)
 {
     UIItemProvider *sourceItemProvider = [simulator sourceItemProviders].firstObject;
     EXPECT_EQ(estimatedSize.width, sourceItemProvider.preferredPresentationSize.width);
     EXPECT_EQ(estimatedSize.height, sourceItemProvider.preferredPresentationSize.height);
 }
 
-static void checkSuggestedNameAndEstimatedSize(DataInteractionSimulator *simulator, NSString *suggestedName, CGSize estimatedSize)
+static void checkSuggestedNameAndEstimatedSize(DragAndDropSimulator *simulator, NSString *suggestedName, CGSize estimatedSize)
 {
     UIItemProvider *sourceItemProvider = [simulator sourceItemProviders].firstObject;
     EXPECT_WK_STREQ(suggestedName.UTF8String, sourceItemProvider.suggestedName.UTF8String);
@@ -246,144 +246,144 @@ static void runTestWithTemporaryFolder(void(^runTest)(NSURL *folderURL))
 
 namespace TestWebKitAPI {
 
-TEST(DataInteractionTests, ImageToContentEditable)
+TEST(DragAndDropTests, ImageToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"image-and-contenteditable"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_TRUE([webView editorContainsImageElement]);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 215, 174) ], [dataInteractionSimulator finalSelectionRects]);
-    checkFirstTypeIsPresentAndSecondTypeIsMissing(dataInteractionSimulator.get(), kUTTypePNG, kUTTypeFileURL);
-    checkEstimatedSize(dataInteractionSimulator.get(), { 215, 174 });
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 215, 174) ], [simulator finalSelectionRects]);
+    checkFirstTypeIsPresentAndSecondTypeIsMissing(simulator.get(), kUTTypePNG, kUTTypeFileURL);
+    checkEstimatedSize(simulator.get(), { 215, 174 });
 }
 
-TEST(DataInteractionTests, CanStartDragOnEnormousImage)
+TEST(DragAndDropTests, CanStartDragOnEnormousImage)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadHTMLString:@"<img src='enormous.svg'></img>"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 100)];
 
-    NSArray *registeredTypes = [[dataInteractionSimulator sourceItemProviders].firstObject registeredTypeIdentifiers];
+    NSArray *registeredTypes = [[simulator sourceItemProviders].firstObject registeredTypeIdentifiers];
     EXPECT_WK_STREQ((NSString *)kUTTypeScalableVectorGraphics, [registeredTypes firstObject]);
 }
 
-TEST(DataInteractionTests, ImageToTextarea)
+TEST(DragAndDropTests, ImageToTextarea)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"image-and-textarea"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("", [webView editorValue]);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkFirstTypeIsPresentAndSecondTypeIsMissing(dataInteractionSimulator.get(), kUTTypePNG, kUTTypeFileURL);
-    checkEstimatedSize(dataInteractionSimulator.get(), { 215, 174 });
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkFirstTypeIsPresentAndSecondTypeIsMissing(simulator.get(), kUTTypePNG, kUTTypeFileURL);
+    checkEstimatedSize(simulator.get(), { 215, 174 });
 }
 
-TEST(DataInteractionTests, ImageInLinkToInput)
+TEST(DragAndDropTests, ImageInLinkToInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"image-in-link-and-input"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("https://www.apple.com/", [webView editorValue].UTF8String);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 2057, 232) ], [dataInteractionSimulator finalSelectionRects]);
-    checkSuggestedNameAndEstimatedSize(dataInteractionSimulator.get(), @"icon.png", { 215, 174 });
-    checkTypeIdentifierIsRegisteredAtIndex(dataInteractionSimulator.get(), (NSString *)kUTTypePNG, 0);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 2057, 232) ], [simulator finalSelectionRects]);
+    checkSuggestedNameAndEstimatedSize(simulator.get(), @"icon.png", { 215, 174 });
+    checkTypeIdentifierIsRegisteredAtIndex(simulator.get(), (NSString *)kUTTypePNG, 0);
 }
 
-TEST(DataInteractionTests, ImageInLinkWithoutHREFToInput)
+TEST(DragAndDropTests, ImageInLinkWithoutHREFToInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"image-in-link-and-input"];
     [webView stringByEvaluatingJavaScript:@"link.href = ''"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("", [webView editorValue]);
-    checkEstimatedSize(dataInteractionSimulator.get(), { 215, 174 });
-    checkTypeIdentifierIsRegisteredAtIndex(dataInteractionSimulator.get(), (NSString *)kUTTypePNG, 0);
+    checkEstimatedSize(simulator.get(), { 215, 174 });
+    checkTypeIdentifierIsRegisteredAtIndex(simulator.get(), (NSString *)kUTTypePNG, 0);
 }
 
-TEST(DataInteractionTests, ImageDoesNotUseElementSizeAsEstimatedSize)
+TEST(DragAndDropTests, ImageDoesNotUseElementSizeAsEstimatedSize)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"gif-and-file-input"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom: { 100, 100 } to: { 100, 300 }];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom: { 100, 100 } to: { 100, 300 }];
 
-    checkTypeIdentifierIsRegisteredAtIndex(dataInteractionSimulator.get(), (NSString *)kUTTypeGIF, 0);
-    checkSuggestedNameAndEstimatedSize(dataInteractionSimulator.get(), @"apple.gif", { 52, 64 });
+    checkTypeIdentifierIsRegisteredAtIndex(simulator.get(), (NSString *)kUTTypeGIF, 0);
+    checkSuggestedNameAndEstimatedSize(simulator.get(), @"apple.gif", { 52, 64 });
     EXPECT_WK_STREQ("apple.gif (image/gif)", [webView stringByEvaluatingJavaScript:@"output.textContent"]);
 }
 
-TEST(DataInteractionTests, ContentEditableToContentEditable)
+TEST(DragAndDropTests, ContentEditableToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"autofocus-contenteditable"];
-    [dataInteractionSimulator waitForInputSession];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator waitForInputSession];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL);
     EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 961, 227) ], [dataInteractionSimulator finalSelectionRects]);
-    checkRichTextTypePrecedesPlainTextType(dataInteractionSimulator.get());
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 961, 227) ], [simulator finalSelectionRects]);
+    checkRichTextTypePrecedesPlainTextType(simulator.get());
 }
 
-TEST(DataInteractionTests, ContentEditableToTextarea)
+TEST(DragAndDropTests, ContentEditableToTextarea)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"contenteditable-and-textarea"];
-    [dataInteractionSimulator waitForInputSession];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator waitForInputSession];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL);
     EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(6, 203, 990, 232) ], [dataInteractionSimulator finalSelectionRects]);
-    checkRichTextTypePrecedesPlainTextType(dataInteractionSimulator.get());
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(6, 203, 990, 232) ], [simulator finalSelectionRects]);
+    checkRichTextTypePrecedesPlainTextType(simulator.get());
 }
 
-TEST(DataInteractionTests, ContentEditableMoveParagraphs)
+TEST(DragAndDropTests, ContentEditableMoveParagraphs)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"two-paragraph-contenteditable"];
-    [dataInteractionSimulator waitForInputSession];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(250, 450)];
+    [simulator waitForInputSession];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(250, 450)];
 
     NSString *finalTextContent = [webView stringByEvaluatingJavaScript:@"editor.textContent"];
     NSUInteger firstParagraphOffset = [finalTextContent rangeOfString:@"This is the first paragraph"].location;
@@ -392,47 +392,47 @@ TEST(DataInteractionTests, ContentEditableMoveParagraphs)
     EXPECT_FALSE(firstParagraphOffset == NSNotFound);
     EXPECT_FALSE(secondParagraphOffset == NSNotFound);
     EXPECT_GT(firstParagraphOffset, secondParagraphOffset);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(190, 100, 130, 20), makeCGRectValue(0, 120, 320, 100), makeCGRectValue(0, 220, 252, 20) ], [dataInteractionSimulator finalSelectionRects]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(190, 100, 130, 20), makeCGRectValue(0, 120, 320, 100), makeCGRectValue(0, 220, 252, 20) ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, DragImageFromContentEditable)
+TEST(DragAndDropTests, DragImageFromContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView synchronouslyLoadTestPageNamed:@"contenteditable-and-target"];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target.textContent"]);
 }
 
-TEST(DataInteractionTests, TextAreaToInput)
+TEST(DragAndDropTests, TextAreaToInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"textarea-to-input"];
-    [dataInteractionSimulator waitForInputSession];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator waitForInputSession];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.value"].length, 0UL);
     EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 990, 232) ], [dataInteractionSimulator finalSelectionRects]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 990, 232) ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, SinglePlainTextWordTypeIdentifiers)
+TEST(DragAndDropTests, SinglePlainTextWordTypeIdentifiers)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"textarea-to-input"];
-    [dataInteractionSimulator waitForInputSession];
+    [simulator waitForInputSession];
     [webView stringByEvaluatingJavaScript:@"source.value = 'pneumonoultramicroscopicsilicovolcanoconiosis'"];
     [webView stringByEvaluatingJavaScript:@"source.selectionStart = 0"];
     [webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
-    NSItemProvider *itemProvider = [dataInteractionSimulator sourceItemProviders].firstObject;
+    NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject;
     NSArray *registeredTypes = [itemProvider registeredTypeIdentifiers];
     EXPECT_EQ(1UL, registeredTypes.count);
     EXPECT_WK_STREQ([(NSString *)kUTTypeUTF8PlainText UTF8String], [registeredTypes.firstObject UTF8String]);
@@ -441,19 +441,19 @@ TEST(DataInteractionTests, SinglePlainTextWordTypeIdentifiers)
     EXPECT_WK_STREQ("pneumonoultramicroscopicsilicovolcanoconiosis", [webView editorValue].UTF8String);
 }
 
-TEST(DataInteractionTests, SinglePlainTextURLTypeIdentifiers)
+TEST(DragAndDropTests, SinglePlainTextURLTypeIdentifiers)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView loadTestPageNamed:@"textarea-to-input"];
-    [dataInteractionSimulator waitForInputSession];
+    [simulator waitForInputSession];
     [webView stringByEvaluatingJavaScript:@"source.value = 'https://webkit.org/'"];
     [webView stringByEvaluatingJavaScript:@"source.selectionStart = 0"];
     [webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
-    NSItemProvider *itemProvider = [dataInteractionSimulator sourceItemProviders].firstObject;
+    NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject;
     NSArray *registeredTypes = [itemProvider registeredTypeIdentifiers];
     EXPECT_EQ(2UL, registeredTypes.count);
     EXPECT_WK_STREQ([(NSString *)kUTTypeURL UTF8String], [registeredTypes.firstObject UTF8String]);
@@ -463,18 +463,18 @@ TEST(DataInteractionTests, SinglePlainTextURLTypeIdentifiers)
     EXPECT_WK_STREQ("https://webkit.org/", [webView editorValue].UTF8String);
 }
 
-TEST(DataInteractionTests, LinkToInput)
+TEST(DragAndDropTests, LinkToInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"link-and-input"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("https://www.apple.com/", [webView editorValue].UTF8String);
 
     __block bool doneLoadingURL = false;
-    UIItemProvider *sourceItemProvider = [dataInteractionSimulator sourceItemProviders].firstObject;
+    UIItemProvider *sourceItemProvider = [simulator sourceItemProviders].firstObject;
     [sourceItemProvider loadObjectOfClass:[NSURL class] completionHandler:^(id object, NSError *error) {
         NSURL *url = object;
         EXPECT_WK_STREQ("Hello world", url._title.UTF8String ?: "");
@@ -482,99 +482,99 @@ TEST(DataInteractionTests, LinkToInput)
     }];
     TestWebKitAPI::Util::run(&doneLoadingURL);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 273, 2057, 232) ], [dataInteractionSimulator finalSelectionRects]);
-    checkTypeIdentifierIsRegisteredAtIndex(dataInteractionSimulator.get(), (NSString *)kUTTypeURL, 0);
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 273, 2057, 232) ], [simulator finalSelectionRects]);
+    checkTypeIdentifierIsRegisteredAtIndex(simulator.get(), (NSString *)kUTTypeURL, 0);
 }
 
-TEST(DataInteractionTests, BackgroundImageLinkToInput)
+TEST(DragAndDropTests, BackgroundImageLinkToInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"background-image-link-and-input"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("https://www.apple.com/", [webView editorValue].UTF8String);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 2057, 232) ], [dataInteractionSimulator finalSelectionRects]);
-    checkTypeIdentifierIsRegisteredAtIndex(dataInteractionSimulator.get(), (NSString *)kUTTypeURL, 0);
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(101, 241, 2057, 232) ], [simulator finalSelectionRects]);
+    checkTypeIdentifierIsRegisteredAtIndex(simulator.get(), (NSString *)kUTTypeURL, 0);
 }
 
-TEST(DataInteractionTests, CanPreventStart)
+TEST(DragAndDropTests, CanPreventStart)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"prevent-start"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
-    EXPECT_EQ(DataInteractionCancelled, [dataInteractionSimulator phase]);
+    EXPECT_EQ(DragAndDropPhaseCancelled, [simulator phase]);
     EXPECT_FALSE([webView editorContainsImageElement]);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_FALSE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_FALSE([observedEventNames containsObject:DataInteractionOverEventName]);
-    checkSelectionRectsWithLogging(@[ ], [dataInteractionSimulator finalSelectionRects]);
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_FALSE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_FALSE([observedEventNames containsObject:@"dragover"]);
+    checkSelectionRectsWithLogging(@[ ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, CanPreventOperation)
+TEST(DragAndDropTests, CanPreventOperation)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"prevent-operation"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
     EXPECT_FALSE([webView editorContainsImageElement]);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    checkSelectionRectsWithLogging(@[ ], [dataInteractionSimulator finalSelectionRects]);
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    checkSelectionRectsWithLogging(@[ ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, EnterAndLeaveEvents)
+TEST(DragAndDropTests, EnterAndLeaveEvents)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"link-and-input"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 450)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 450)];
 
     EXPECT_WK_STREQ("", [webView editorValue].UTF8String);
 
-    NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
-    EXPECT_TRUE([observedEventNames containsObject:DataInteractionLeaveEventName]);
-    EXPECT_FALSE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
-    checkSelectionRectsWithLogging(@[ ], [dataInteractionSimulator finalSelectionRects]);
+    NSArray *observedEventNames = [simulator observedEventNames];
+    EXPECT_TRUE([observedEventNames containsObject:@"dragenter"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragover"]);
+    EXPECT_TRUE([observedEventNames containsObject:@"dragleave"]);
+    EXPECT_FALSE([observedEventNames containsObject:@"drop"]);
+    checkSelectionRectsWithLogging(@[ ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, CanStartDragOnDivWithDraggableAttribute)
+TEST(DragAndDropTests, CanStartDragOnDivWithDraggableAttribute)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"custom-draggable-div"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 250)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 250)];
 
-    EXPECT_GT([dataInteractionSimulator sourceItemProviders].count, 0UL);
-    NSItemProvider *itemProvider = [dataInteractionSimulator sourceItemProviders].firstObject;
+    EXPECT_GT([simulator sourceItemProviders].count, 0UL);
+    NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject;
     EXPECT_EQ(UIPreferredPresentationStyleInline, itemProvider.preferredPresentationStyle);
     EXPECT_TRUE([webView stringByEvaluatingJavaScript:@"!!destination.querySelector('#item')"]);
     EXPECT_WK_STREQ(@"PASS", [webView stringByEvaluatingJavaScript:@"item.textContent"]);
 }
 
-TEST(DataInteractionTests, ExternalSourcePlainTextToIFrame)
+TEST(DragAndDropTests, ExternalSourcePlainTextToIFrame)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"contenteditable-in-iframe"];
@@ -582,7 +582,7 @@ TEST(DataInteractionTests, ExternalSourcePlainTextToIFrame)
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerObject:@"Hello world" visibility:UIItemProviderRepresentationOptionsVisibilityAll];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     [simulator setExternalItemProviders:@[ itemProvider.get() ]];
     [simulator runFrom:CGPointMake(0, 0) to:CGPointMake(160, 250)];
 
@@ -593,7 +593,7 @@ TEST(DataInteractionTests, ExternalSourcePlainTextToIFrame)
     checkDragCaretRectIsContainedInRect([simulator lastKnownDragCaretRect], CGRectMake(containerLeft, containerTop, containerWidth, containerHeight));
 }
 
-TEST(DataInteractionTests, ExternalSourceInlineTextToFileInput)
+TEST(DragAndDropTests, ExternalSourceInlineTextToFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -602,14 +602,14 @@ TEST(DataInteractionTests, ExternalSourceInlineTextToFileInput)
     [simulatedItemProvider setPreferredPresentationStyle:UIPreferredPresentationStyleInline];
     [simulatedItemProvider registerObject:@"This item provider requested inline presentation style." visibility:NSItemProviderRepresentationVisibilityAll];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"output.value"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceJSONToFileInput)
+TEST(DragAndDropTests, ExternalSourceJSONToFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -618,14 +618,14 @@ TEST(DataInteractionTests, ExternalSourceJSONToFileInput)
     NSData *jsonData = [@"{ \"foo\": \"bar\",  \"bar\": \"baz\" }" dataUsingEncoding:NSUTF8StringEncoding];
     [simulatedJSONItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeJSON withData:jsonData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedJSONItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedJSONItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     EXPECT_WK_STREQ("application/json", [webView stringByEvaluatingJavaScript:@"output.value"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceImageToFileInput)
+TEST(DragAndDropTests, ExternalSourceImageToFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -634,15 +634,15 @@ TEST(DataInteractionTests, ExternalSourceImageToFileInput)
     NSData *imageData = UIImageJPEGRepresentation(testIconImage(), 0.5);
     [simulatedImageItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeJPEG withData:imageData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedImageItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedImageItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("image/jpeg", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceHTMLToUploadArea)
+TEST(DragAndDropTests, ExternalSourceHTMLToUploadArea)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -652,16 +652,16 @@ TEST(DataInteractionTests, ExternalSourceHTMLToUploadArea)
     [simulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:htmlData];
     [simulatedHTMLItemProvider setSuggestedName:@"index.html"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setShouldAllowMoveOperation:NO];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setShouldAllowMoveOperation:NO];
+    [simulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("text/html", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceMoveOperationNotAllowed)
+TEST(DragAndDropTests, ExternalSourceMoveOperationNotAllowed)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -671,15 +671,15 @@ TEST(DataInteractionTests, ExternalSourceMoveOperationNotAllowed)
     NSData *htmlData = [@"<body contenteditable></body>" dataUsingEncoding:NSUTF8StringEncoding];
     [simulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:htmlData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setShouldAllowMoveOperation:NO];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setShouldAllowMoveOperation:NO];
+    [simulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"output.value"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceZIPArchiveAndURLToSingleFileInput)
+TEST(DragAndDropTests, ExternalSourceZIPArchiveAndURLToSingleFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -690,15 +690,15 @@ TEST(DataInteractionTests, ExternalSourceZIPArchiveAndURLToSingleFileInput)
     auto urlProvider = adoptNS([[UIItemProvider alloc] init]);
     [urlProvider registerObject:[NSURL URLWithString:@"https://webkit.org"] visibility:UIItemProviderRepresentationOptionsVisibilityAll];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ archiveProvider.get(), urlProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ archiveProvider.get(), urlProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("application/zip", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceZIPArchiveToUploadArea)
+TEST(DragAndDropTests, ExternalSourceZIPArchiveToUploadArea)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -706,15 +706,15 @@ TEST(DataInteractionTests, ExternalSourceZIPArchiveToUploadArea)
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeZipArchive withData:testZIPArchive()];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("application/zip", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceImageAndHTMLToSingleFileInput)
+TEST(DragAndDropTests, ExternalSourceImageAndHTMLToSingleFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -727,15 +727,15 @@ TEST(DataInteractionTests, ExternalSourceImageAndHTMLToSingleFileInput)
     NSData *htmlData = [@"<body contenteditable></body>" dataUsingEncoding:NSUTF8StringEncoding];
     [simulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:htmlData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get(), simulatedImageItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get(), simulatedImageItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceImageAndHTMLToMultipleFileInput)
+TEST(DragAndDropTests, ExternalSourceImageAndHTMLToMultipleFileInput)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -749,15 +749,15 @@ TEST(DataInteractionTests, ExternalSourceImageAndHTMLToMultipleFileInput)
     NSData *htmlData = [@"<body contenteditable></body>" dataUsingEncoding:NSUTF8StringEncoding];
     [simulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:htmlData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get(), simulatedImageItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedHTMLItemProvider.get(), simulatedImageItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 100) to:CGPointMake(100, 100)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("image/jpeg, text/html", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceImageAndHTMLToUploadArea)
+TEST(DragAndDropTests, ExternalSourceImageAndHTMLToUploadArea)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -774,81 +774,81 @@ TEST(DataInteractionTests, ExternalSourceImageAndHTMLToUploadArea)
     NSData *secondHTMLData = [@"<html><body>hello world</body></html>" dataUsingEncoding:NSUTF8StringEncoding];
     [secondSimulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:secondHTMLData];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setShouldAllowMoveOperation:NO];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedImageItemProvider.get(), firstSimulatedHTMLItemProvider.get(), secondSimulatedHTMLItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setShouldAllowMoveOperation:NO];
+    [simulator setExternalItemProviders:@[ simulatedImageItemProvider.get(), firstSimulatedHTMLItemProvider.get(), secondSimulatedHTMLItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("image/jpeg, text/html, text/html", outputValue.UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceHTMLToContentEditable)
+TEST(DragAndDropTests, ExternalSourceHTMLToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     NSData *htmlData = [@"<h1>This is a test</h1>" dataUsingEncoding:NSUTF8StringEncoding];
     [itemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:htmlData];
-    [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     NSString *textContent = [webView stringByEvaluatingJavaScript:@"editor.textContent"];
     EXPECT_WK_STREQ("This is a test", textContent.UTF8String);
     EXPECT_TRUE([webView stringByEvaluatingJavaScript:@"!!editor.querySelector('h1')"].boolValue);
 }
 
-TEST(DataInteractionTests, ExternalSourceBoldSystemAttributedStringToContentEditable)
+TEST(DragAndDropTests, ExternalSourceBoldSystemAttributedStringToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     NSDictionary *textAttributes = @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:20] };
     NSAttributedString *richText = [[NSAttributedString alloc] initWithString:@"This is a test" attributes:textAttributes];
     auto itemProvider = adoptNS([[UIItemProvider alloc] initWithObject:richText]);
-    [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("This is a test", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceColoredAttributedStringToContentEditable)
+TEST(DragAndDropTests, ExternalSourceColoredAttributedStringToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     NSDictionary *textAttributes = @{ NSForegroundColorAttributeName: [UIColor redColor] };
     NSAttributedString *richText = [[NSAttributedString alloc] initWithString:@"This is a test" attributes:textAttributes];
     auto itemProvider = adoptNS([[UIItemProvider alloc] initWithObject:richText]);
-    [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("rgb(255, 0, 0)", [webView stringByEvaluatingJavaScript:@"getComputedStyle(document.querySelector('p')).color"]);
     EXPECT_WK_STREQ("This is a test", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
 }
 
-TEST(DataInteractionTests, ExternalSourceMultipleURLsToContentEditable)
+TEST(DragAndDropTests, ExternalSourceMultipleURLsToContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto firstItem = adoptNS([[UIItemProvider alloc] init]);
     [firstItem registerObject:[NSURL URLWithString:@"https://www.apple.com/iphone/"] visibility:UIItemProviderRepresentationOptionsVisibilityAll];
     auto secondItem = adoptNS([[UIItemProvider alloc] init]);
     [secondItem registerObject:[NSURL URLWithString:@"https://www.apple.com/mac/"] visibility:UIItemProviderRepresentationOptionsVisibilityAll];
     auto thirdItem = adoptNS([[UIItemProvider alloc] init]);
     [thirdItem registerObject:[NSURL URLWithString:@"https://webkit.org/"] visibility:UIItemProviderRepresentationOptionsVisibilityAll];
-    [dataInteractionSimulator setExternalItemProviders:@[ firstItem.get(), secondItem.get(), thirdItem.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ firstItem.get(), secondItem.get(), thirdItem.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     NSArray *droppedURLs = [webView objectByEvaluatingJavaScript:@"Array.from(editor.querySelectorAll('a')).map(a => a.href)"];
     EXPECT_EQ(3UL, droppedURLs.count);
@@ -863,13 +863,13 @@ TEST(DataInteractionTests, ExternalSourceMultipleURLsToContentEditable)
     EXPECT_WK_STREQ("https://webkit.org/", linksSeparatedByLine[2]);
 }
 
-TEST(DataInteractionTests, RespectsExternalSourceFidelityRankings)
+TEST(DragAndDropTests, RespectsExternalSourceFidelityRankings)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     // Here, our source item provider vends two representations: plain text, and then an image. If we don't respect the
     // fidelity order requested by the source, we'll end up assuming that the image is a higher fidelity representation
@@ -878,9 +878,9 @@ TEST(DataInteractionTests, RespectsExternalSourceFidelityRankings)
     auto simulatedItemProviderWithTextFirst = adoptNS([[UIItemProvider alloc] init]);
     [simulatedItemProviderWithTextFirst registerObject:@"Hello world" visibility:UIItemProviderRepresentationOptionsVisibilityAll];
     [simulatedItemProviderWithTextFirst registerObject:testIconImage() visibility:UIItemProviderRepresentationOptionsVisibilityAll];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProviderWithTextFirst.get() ]];
+    [simulator setExternalItemProviders:@[ simulatedItemProviderWithTextFirst.get() ]];
 
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
     EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"editor.textContent"]);
     EXPECT_FALSE([webView editorContainsImageElement]);
     [webView stringByEvaluatingJavaScript:@"editor.innerHTML = ''"];
@@ -889,51 +889,51 @@ TEST(DataInteractionTests, RespectsExternalSourceFidelityRankings)
     auto simulatedItemProviderWithImageFirst = adoptNS([[UIItemProvider alloc] init]);
     [simulatedItemProviderWithImageFirst registerObject:testIconImage() visibility:UIItemProviderRepresentationOptionsVisibilityAll];
     [simulatedItemProviderWithImageFirst registerObject:@"Hello world" visibility:UIItemProviderRepresentationOptionsVisibilityAll];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProviderWithImageFirst.get() ]];
+    [simulator setExternalItemProviders:@[ simulatedItemProviderWithImageFirst.get() ]];
 
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
     EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"editor.textContent"]);
     EXPECT_TRUE([webView editorContainsImageElement]);
 }
 
-TEST(DataInteractionTests, ExternalSourceUTF8PlainTextOnly)
+TEST(DragAndDropTests, ExternalSourceUTF8PlainTextOnly)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
 
     NSString *textPayload = @"Ceci n'est pas une string";
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto simulatedItemProvider = adoptNS([[UIItemProvider alloc] init]);
     [simulatedItemProvider registerDataRepresentationForTypeIdentifier:(__bridge NSString *)kUTTypeUTF8PlainText options:nil loadHandler:^NSProgress *(UIItemProviderDataLoadCompletionBlock completionBlock)
     {
         completionBlock([textPayload dataUsingEncoding:NSUTF8StringEncoding], nil);
         return [NSProgress discreteProgressWithTotalUnitCount:100];
     }];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
     EXPECT_WK_STREQ(textPayload.UTF8String, [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 1936, 227) ], [dataInteractionSimulator finalSelectionRects]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 1936, 227) ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, ExternalSourceJPEGOnly)
+TEST(DragAndDropTests, ExternalSourceJPEGOnly)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto simulatedItemProvider = adoptNS([[UIItemProvider alloc] init]);
     [simulatedItemProvider registerDataRepresentationForTypeIdentifier:(__bridge NSString *)kUTTypeJPEG options:nil loadHandler:^NSProgress *(UIItemProviderDataLoadCompletionBlock completionBlock)
     {
         completionBlock(UIImageJPEGRepresentation(testIconImage(), 0.5), nil);
         return [NSProgress discreteProgressWithTotalUnitCount:100];
     }];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
     EXPECT_TRUE([webView editorContainsImageElement]);
-    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 215, 174) ], [dataInteractionSimulator finalSelectionRects]);
+    checkSelectionRectsWithLogging(@[ makeCGRectValue(1, 201, 215, 174) ], [simulator finalSelectionRects]);
 }
 
-TEST(DataInteractionTests, ExternalSourceTitledNSURL)
+TEST(DragAndDropTests, ExternalSourceTitledNSURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
@@ -944,15 +944,15 @@ TEST(DataInteractionTests, ExternalSourceTitledNSURL)
     auto simulatedItemProvider = adoptNS([[UIItemProvider alloc] init]);
     [simulatedItemProvider registerObject:titledURL visibility:UIItemProviderRepresentationOptionsVisibilityAll];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("Apple", [webView stringByEvaluatingJavaScript:@"editor.querySelector('a').textContent"]);
     EXPECT_WK_STREQ("https://www.apple.com/", [webView stringByEvaluatingJavaScript:@"editor.querySelector('a').href"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceFileURL)
+TEST(DragAndDropTests, ExternalSourceFileURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
@@ -961,15 +961,15 @@ TEST(DataInteractionTests, ExternalSourceFileURL)
     NSURL *URL = [NSURL URLWithString:@"file:///some/file/that/is/not/real"];
     UIItemProvider *simulatedItemProvider = [UIItemProvider itemProviderWithURL:URL title:@""];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_FALSE([[webView stringByEvaluatingJavaScript:@"!!editor.querySelector('a')"] boolValue]);
     EXPECT_WK_STREQ("Hello world\nfile:///some/file/that/is/not/real", [webView stringByEvaluatingJavaScript:@"document.body.innerText"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceOverrideDropFileUpload)
+TEST(DragAndDropTests, ExternalSourceOverrideDropFileUpload)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"file-uploading"];
@@ -983,8 +983,8 @@ TEST(DataInteractionTests, ExternalSourceOverrideDropFileUpload)
     [simulatedHTMLItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:firstHTMLData];
     [simulatedHTMLItemProvider setPreferredPresentationStyle:UIPreferredPresentationStyleAttachment];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
     {
         EXPECT_EQ(2UL, session.items.count);
         UIDragItem *firstItem = session.items[0];
@@ -993,8 +993,8 @@ TEST(DataInteractionTests, ExternalSourceOverrideDropFileUpload)
         EXPECT_TRUE([secondItem.itemProvider.registeredTypeIdentifiers isEqual:@[ (NSString *)kUTTypeHTML ]]);
         return @[ secondItem ];
     }];
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedImageItemProvider.get(), simulatedHTMLItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ simulatedImageItemProvider.get(), simulatedHTMLItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(200, 300) to:CGPointMake(100, 300)];
 
     NSString *outputValue = [webView stringByEvaluatingJavaScript:@"output.value"];
     EXPECT_WK_STREQ("text/html", outputValue.UTF8String);
@@ -1014,7 +1014,7 @@ static RetainPtr<TestWKWebView> setUpTestWebViewForDataTransferItems()
     return webView;
 }
 
-TEST(DataInteractionTests, ExternalSourceDataTransferItemGetFolderAsEntry)
+TEST(DragAndDropTests, ExternalSourceDataTransferItemGetFolderAsEntry)
 {
     // The expected output is sorted by alphabetical order here for consistent behavior across different test environments.
     // See DataTransferItem-getAsEntry.html for more details.
@@ -1043,16 +1043,16 @@ TEST(DataInteractionTests, ExternalSourceDataTransferItemGetFolderAsEntry)
             return nil;
         }];
 
-        auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-        [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-        [dataInteractionSimulator runFrom:CGPointMake(50, 50) to:CGPointMake(150, 50)];
+        auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+        [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+        [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(150, 50)];
     });
 
     TestWebKitAPI::Util::run(&done);
     EXPECT_WK_STREQ([expectedOutput componentsJoinedByString:@"\n"], [webView stringByEvaluatingJavaScript:@"output.value"]);
 }
 
-TEST(DataInteractionTests, ExternalSourceDataTransferItemGetPlainTextFileAsEntry)
+TEST(DragAndDropTests, ExternalSourceDataTransferItemGetPlainTextFileAsEntry)
 {
     NSArray<NSString *> *expectedOutput = @[
         @"Found data transfer item (kind: 'file', type: 'text/plain')",
@@ -1073,9 +1073,9 @@ TEST(DataInteractionTests, ExternalSourceDataTransferItemGetPlainTextFileAsEntry
             return nil;
         }];
 
-        auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-        [dataInteractionSimulator setExternalItemProviders:@[ itemProvider.get() ]];
-        [dataInteractionSimulator runFrom:CGPointMake(50, 50) to:CGPointMake(150, 50)];
+        auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+        [simulator setExternalItemProviders:@[ itemProvider.get() ]];
+        [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(150, 50)];
     });
 
     TestWebKitAPI::Util::run(&done);
@@ -1084,14 +1084,14 @@ TEST(DataInteractionTests, ExternalSourceDataTransferItemGetPlainTextFileAsEntry
 
 #endif // __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300
 
-TEST(DataInteractionTests, ExternalSourceOverrideDropInsertURL)
+TEST(DragAndDropTests, ExternalSourceOverrideDropInsertURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"autofocus-contenteditable"];
     [webView stringByEvaluatingJavaScript:@"getSelection().removeAllRanges()"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
     {
         NSMutableArray<UIDragItem *> *allowedItems = [NSMutableArray array];
         for (UIDragItem *item in session.items) {
@@ -1106,13 +1106,13 @@ TEST(DataInteractionTests, ExternalSourceOverrideDropInsertURL)
     [firstItemProvider registerObject:@"This is a string." visibility:UIItemProviderRepresentationOptionsVisibilityAll];
     auto secondItemProvider = adoptNS([[UIItemProvider alloc] init]);
     [secondItemProvider registerObject:[NSURL URLWithString:@"https://webkit.org/"] visibility:UIItemProviderRepresentationOptionsVisibilityAll];
-    [dataInteractionSimulator setExternalItemProviders:@[ firstItemProvider.get(), secondItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator setExternalItemProviders:@[ firstItemProvider.get(), secondItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("https://webkit.org/", [webView stringByEvaluatingJavaScript:@"editor.textContent"]);
 }
 
-TEST(DataInteractionTests, OverrideDataInteractionOperation)
+TEST(DragAndDropTests, OverrideDrop)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"simple"];
@@ -1121,14 +1121,14 @@ TEST(DataInteractionTests, OverrideDataInteractionOperation)
     [simulatedItemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML withData:[@"<body></body>" dataUsingEncoding:NSUTF8StringEncoding]];
 
     __block bool finishedLoadingData = false;
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator setOverrideDataInteractionOperationBlock:^NSUInteger(NSUInteger operation, id session)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator setOverrideDragUpdateBlock:^NSUInteger(NSUInteger operation, id session)
     {
         EXPECT_EQ(0U, operation);
         return UIDropOperationCopy;
     }];
-    [dataInteractionSimulator setDataInteractionOperationCompletionBlock:^(BOOL handled, NSArray *itemProviders) {
+    [simulator setDropCompletionBlock:^(BOOL handled, NSArray *itemProviders) {
         EXPECT_FALSE(handled);
         [itemProviders.firstObject loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeHTML completionHandler:^(NSData *data, NSError *error) {
             NSString *text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
@@ -1137,11 +1137,11 @@ TEST(DataInteractionTests, OverrideDataInteractionOperation)
             finishedLoadingData = true;
         }];
     }];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
     TestWebKitAPI::Util::run(&finishedLoadingData);
 }
 
-TEST(DataInteractionTests, InjectedBundleOverridePerformTwoStepDrop)
+TEST(DragAndDropTests, InjectedBundleOverridePerformTwoStepDrop)
 {
     WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"];
     [configuration.processPool _setObject:@YES forBundleParameter:@"BundleOverridePerformTwoStepDrop"];
@@ -1157,14 +1157,14 @@ TEST(DataInteractionTests, InjectedBundleOverridePerformTwoStepDrop)
         return [NSProgress discreteProgressWithTotalUnitCount:100];
     }];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_EQ(0UL, [webView stringByEvaluatingJavaScript:@"editor.textContent"].length);
 }
 
-TEST(DataInteractionTests, InjectedBundleAllowPerformTwoStepDrop)
+TEST(DragAndDropTests, InjectedBundleAllowPerformTwoStepDrop)
 {
     WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"];
     [configuration.processPool _setObject:@NO forBundleParameter:@"BundleOverridePerformTwoStepDrop"];
@@ -1180,14 +1180,14 @@ TEST(DataInteractionTests, InjectedBundleAllowPerformTwoStepDrop)
         return [NSProgress discreteProgressWithTotalUnitCount:100];
     }];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
-    [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setExternalItemProviders:@[ simulatedItemProvider.get() ]];
+    [simulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
 
     EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
 }
 
-TEST(DataInteractionTests, InjectedBundleImageElementData)
+TEST(DragAndDropTests, InjectedBundleImageElementData)
 {
     WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"];
     [configuration _setAttachmentElementEnabled:YES];
@@ -1195,19 +1195,19 @@ TEST(DataInteractionTests, InjectedBundleImageElementData)
     [webView synchronouslyLoadTestPageNamed:@"image-and-contenteditable"];
 
     __block RetainPtr<NSString> injectedString;
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *data)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *data)
     {
         injectedString = adoptNS([[NSString alloc] initWithData:data[InjectedBundlePasteboardDataType] encoding:NSUTF8StringEncoding]);
         return @[ itemProvider ];
     }];
 
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 250)];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 250)];
 
     EXPECT_WK_STREQ("hello", [injectedString UTF8String]);
 }
 
-TEST(DataInteractionTests, InjectedBundleAttachmentElementData)
+TEST(DragAndDropTests, InjectedBundleAttachmentElementData)
 {
     WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"];
     [configuration _setAttachmentElementEnabled:YES];
@@ -1215,20 +1215,20 @@ TEST(DataInteractionTests, InjectedBundleAttachmentElementData)
     [webView synchronouslyLoadTestPageNamed:@"attachment-element"];
 
     __block RetainPtr<NSString> injectedString;
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *data)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *data)
     {
         injectedString = adoptNS([[NSString alloc] initWithData:data[InjectedBundlePasteboardDataType] encoding:NSUTF8StringEncoding]);
         return @[ itemProvider ];
     }];
 
-    [dataInteractionSimulator runFrom:CGPointMake(50, 50) to:CGPointMake(50, 400)];
+    [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(50, 400)];
 
     EXPECT_WK_STREQ("hello", [injectedString UTF8String]);
     EXPECT_TRUE([webView stringByEvaluatingJavaScript:@"getSelection().isCollapsed"].boolValue);
 }
 
-TEST(DataInteractionTests, LargeImageToTargetDiv)
+TEST(DragAndDropTests, LargeImageToTargetDiv)
 {
     auto testWebViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
     [[testWebViewConfiguration preferences] _setLargeImageAsyncDecodingEnabled:NO];
@@ -1236,48 +1236,48 @@ TEST(DataInteractionTests, LargeImageToTargetDiv)
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500) configuration:testWebViewConfiguration.get()]);
     [webView synchronouslyLoadTestPageNamed:@"div-and-large-image"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(200, 400) to:CGPointMake(200, 150)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(200, 400) to:CGPointMake(200, 150)];
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target.textContent"].UTF8String);
-    checkFirstTypeIsPresentAndSecondTypeIsMissing(dataInteractionSimulator.get(), kUTTypePNG, kUTTypeFileURL);
-    checkEstimatedSize(dataInteractionSimulator.get(), { 2000, 2000 });
+    checkFirstTypeIsPresentAndSecondTypeIsMissing(simulator.get(), kUTTypePNG, kUTTypeFileURL);
+    checkEstimatedSize(simulator.get(), { 2000, 2000 });
 }
 
-TEST(DataInteractionTests, LinkWithEmptyHREF)
+TEST(DragAndDropTests, LinkWithEmptyHREF)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"link-and-input"];
     [webView stringByEvaluatingJavaScript:@"document.querySelector('a').href = ''"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
 
-    EXPECT_EQ(DataInteractionCancelled, [dataInteractionSimulator phase]);
+    EXPECT_EQ(DragAndDropPhaseCancelled, [simulator phase]);
     EXPECT_WK_STREQ("", [webView editorValue].UTF8String);
 }
 
-TEST(DataInteractionTests, CancelledLiftDoesNotCauseSubsequentDragsToFail)
+TEST(DragAndDropTests, CancelledLiftDoesNotCauseSubsequentDragsToFail)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"link-and-target-div"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *, NSArray *, NSDictionary *)
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *, NSArray *, NSDictionary *)
     {
         return @[ ];
     }];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
-    EXPECT_EQ(DataInteractionCancelled, [dataInteractionSimulator phase]);
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    EXPECT_EQ(DragAndDropPhaseCancelled, [simulator phase]);
     EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"target.textContent"]);
     NSString *outputText = [webView stringByEvaluatingJavaScript:@"output.textContent"];
     checkStringArraysAreEqual(@[@"dragstart", @"dragend"], [outputText componentsSeparatedByString:@" "]);
 
     [webView stringByEvaluatingJavaScript:@"output.innerHTML = ''"];
-    [dataInteractionSimulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *)
+    [simulator setConvertItemProvidersBlock:^NSArray *(UIItemProvider *itemProvider, NSArray *, NSDictionary *)
     {
         return @[ itemProvider ];
     }];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target.textContent"]);
     [webView stringByEvaluatingJavaScript:@"output.textContent"];
     checkStringArraysAreEqual(@[@"dragstart", @"dragend"], [outputText componentsSeparatedByString:@" "]);
@@ -1285,7 +1285,7 @@ TEST(DataInteractionTests, CancelledLiftDoesNotCauseSubsequentDragsToFail)
 
 static void testDragAndDropOntoTargetElements(TestWKWebView *webView)
 {
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView]);
     [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(50, 250)];
     EXPECT_WK_STREQ("rgb(0, 128, 0)", [webView stringByEvaluatingJavaScript:@"getComputedStyle(target1).backgroundColor"]);
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target1.textContent"]);
@@ -1299,7 +1299,7 @@ static void testDragAndDropOntoTargetElements(TestWKWebView *webView)
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target3.textContent"]);
 }
 
-TEST(DataInteractionTests, DragEventClientCoordinatesBasic)
+TEST(DragAndDropTests, DragEventClientCoordinatesBasic)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"drop-targets"];
@@ -1307,7 +1307,7 @@ TEST(DataInteractionTests, DragEventClientCoordinatesBasic)
     testDragAndDropOntoTargetElements(webView.get());
 }
 
-TEST(DataInteractionTests, DragEventClientCoordinatesWithScrollOffset)
+TEST(DragAndDropTests, DragEventClientCoordinatesWithScrollOffset)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"drop-targets"];
@@ -1318,7 +1318,7 @@ TEST(DataInteractionTests, DragEventClientCoordinatesWithScrollOffset)
     testDragAndDropOntoTargetElements(webView.get());
 }
 
-TEST(DataInteractionTests, DragEventPageCoordinatesBasic)
+TEST(DragAndDropTests, DragEventPageCoordinatesBasic)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"drop-targets"];
@@ -1327,7 +1327,7 @@ TEST(DataInteractionTests, DragEventPageCoordinatesBasic)
     testDragAndDropOntoTargetElements(webView.get());
 }
 
-TEST(DataInteractionTests, DragEventPageCoordinatesWithScrollOffset)
+TEST(DragAndDropTests, DragEventPageCoordinatesWithScrollOffset)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"drop-targets"];
@@ -1339,12 +1339,12 @@ TEST(DataInteractionTests, DragEventPageCoordinatesWithScrollOffset)
     testDragAndDropOntoTargetElements(webView.get());
 }
 
-TEST(DataInteractionTests, DoNotCrashWhenSelectionIsClearedInDragStart)
+TEST(DragAndDropTests, DoNotCrashWhenSelectionIsClearedInDragStart)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dragstart-clear-selection"];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     [simulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 100)];
 
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"paragraph.textContent"]);
@@ -1352,29 +1352,29 @@ TEST(DataInteractionTests, DoNotCrashWhenSelectionIsClearedInDragStart)
 
 // FIXME: Re-enable this test once we resolve <https://bugs.webkit.org/show_bug.cgi?id=175204>
 #if __IPHONE_OS_VERSION_MAX_ALLOWED <= 110401
-TEST(DataInteractionTests, CustomActionSheetPopover)
+TEST(DragAndDropTests, CustomActionSheetPopover)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"link-and-target-div"];
 
-    auto dataInteractionSimulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
-    [dataInteractionSimulator setShouldEnsureUIApplication:YES];
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
+    [simulator setShouldEnsureUIApplication:YES];
 
     __block BOOL didInvokeCustomActionSheet = NO;
-    [dataInteractionSimulator setShowCustomActionSheetBlock:^BOOL(_WKActivatedElementInfo *element)
+    [simulator setShowCustomActionSheetBlock:^BOOL(_WKActivatedElementInfo *element)
     {
         EXPECT_EQ(_WKActivatedElementTypeLink, element.type);
         EXPECT_WK_STREQ("Hello world", element.title.UTF8String);
         didInvokeCustomActionSheet = YES;
         return YES;
     }];
-    [dataInteractionSimulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
+    [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
     EXPECT_TRUE(didInvokeCustomActionSheet);
     EXPECT_WK_STREQ("PASS", [webView stringByEvaluatingJavaScript:@"target.textContent"].UTF8String);
 }
 #endif
 
-TEST(DataInteractionTests, UnresponsivePageDoesNotHangUI)
+TEST(DragAndDropTests, UnresponsivePageDoesNotHangUI)
 {
     _WKProcessPoolConfiguration *processPoolConfiguration = [[[_WKProcessPoolConfiguration alloc] init] autorelease];
     processPoolConfiguration.ignoreSynchronousMessagingTimeoutsForTesting = YES;
@@ -1383,12 +1383,12 @@ TEST(DataInteractionTests, UnresponsivePageDoesNotHangUI)
     [webView synchronouslyLoadTestPageNamed:@"simple"];
     [webView evaluateJavaScript:@"while(1);" completionHandler:nil];
 
-    // The test passes if we can prepare for data interaction without timing out.
+    // The test passes if we can prepare for a drag session without timing out.
     auto dragSession = adoptNS([[MockDragSession alloc] init]);
     [(id <UIDragInteractionDelegate_ForWebKitOnly>)[webView dragInteractionDelegate] _dragInteraction:[webView dragInteraction] prepareForSession:dragSession.get() completion:^() { }];
 }
 
-TEST(DataInteractionTests, WebItemProviderPasteboardLoading)
+TEST(DragAndDropTests, WebItemProviderPasteboardLoading)
 {
     static NSString *fastString = @"This data loads quickly";
     static NSString *slowString = @"This data loads slowly";
@@ -1434,25 +1434,25 @@ TEST(DataInteractionTests, WebItemProviderPasteboardLoading)
     TestWebKitAPI::Util::run(&hasRunSecondCompletionBlock);
 }
 
-TEST(DataInteractionTests, DoNotCrashWhenSelectionMovesOffscreenAfterDragStart)
+TEST(DragAndDropTests, DoNotCrashWhenSelectionMovesOffscreenAfterDragStart)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dragstart-change-selection-offscreen"];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     [simulator runFrom:CGPointMake(100, 100) to:CGPointMake(100, 100)];
 
     EXPECT_WK_STREQ("FAR OFFSCREEN", [webView stringByEvaluatingJavaScript:@"getSelection().getRangeAt(0).toString()"]);
 }
 
-TEST(DataInteractionTests, AdditionalItemsCanBePreventedOnDragStart)
+TEST(DragAndDropTests, AdditionalItemsCanBePreventedOnDragStart)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"selected-text-image-link-and-editable"];
     [webView stringByEvaluatingJavaScript:@"link.addEventListener('dragstart', e => e.preventDefault())"];
     [webView stringByEvaluatingJavaScript:@"image.addEventListener('dragstart', e => e.preventDefault())"];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(50, 400) additionalItemRequestLocations:@{
         @0.33: [NSValue valueWithCGPoint:CGPointMake(50, 150)],
         @0.66: [NSValue valueWithCGPoint:CGPointMake(50, 250)]
@@ -1460,12 +1460,12 @@ TEST(DataInteractionTests, AdditionalItemsCanBePreventedOnDragStart)
     EXPECT_WK_STREQ("ABCD", [webView stringByEvaluatingJavaScript:@"editor.textContent"]);
 }
 
-TEST(DataInteractionTests, AdditionalLinkAndImageIntoContentEditable)
+TEST(DragAndDropTests, AdditionalLinkAndImageIntoContentEditable)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"selected-text-image-link-and-editable"];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     [simulator runFrom:CGPointMake(50, 50) to:CGPointMake(50, 400) additionalItemRequestLocations:@{
         @0.33: [NSValue valueWithCGPoint:CGPointMake(50, 150)],
         @0.66: [NSValue valueWithCGPoint:CGPointMake(50, 250)]
@@ -1475,11 +1475,11 @@ TEST(DataInteractionTests, AdditionalLinkAndImageIntoContentEditable)
     EXPECT_WK_STREQ("https://www.apple.com/", [webView stringByEvaluatingJavaScript:@"editor.querySelector('a').href"]);
 }
 
-TEST(DataInteractionTests, DragLiftPreviewDataTransferSetDragImage)
+TEST(DragAndDropTests, DragLiftPreviewDataTransferSetDragImage)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"DataTransfer-setDragImage"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     // Use DataTransfer.setDragImage to specify an existing image element in the DOM.
     [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(250, 50)];
@@ -1509,13 +1509,13 @@ static NSData *testIconImageData()
     return [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png" inDirectory:@"TestWebKitAPI.resources"]];
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageAndMarkup)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingImageAndMarkup)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     WKPreferencesSetCustomPasteboardDataEnabled((WKPreferencesRef)[webView configuration].preferences, true);
     [webView synchronouslyLoadTestPageNamed:@"DataTransfer"];
 
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypePNG withData:testIconImageData()];
     NSString *markupString = @"<script>bar()</script><strong onmousedown=javascript:void(0)>HELLO WORLD</strong>";
@@ -1533,11 +1533,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageAndMarkup)
     EXPECT_FALSE([[webView stringByEvaluatingJavaScript:@"rawHTMLData.textContent"] containsString:@"script"]);
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingPlainText)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingPlainText)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(plain)"];
     [simulator runFrom:CGPointMake(50, 75) to:CGPointMake(50, 375)];
@@ -1547,11 +1547,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingPlainText)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingCustomData)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingCustomData)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"writeCustomData = true"];
@@ -1576,11 +1576,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingCustomData)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingURL)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"rich.innerHTML = '<a href=\"https://www.apple.com/\">This is a link.</a>'"];
     [simulator runFrom:CGPointMake(50, 225) to:CGPointMake(50, 375)];
@@ -1596,11 +1596,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingURL)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageWithFileURL)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingImageWithFileURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     NSURL *iconURL = [[NSBundle mainBundle] URLForResource:@"icon" withExtension:@"png" subdirectory:@"TestWebKitAPI.resources"];
@@ -1620,11 +1620,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageWithFileURL)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageWithHTTPURL)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingImageWithHTTPURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeJPEG visibility:NSItemProviderRepresentationVisibilityAll loadHandler:^NSProgress *(DataLoadCompletionBlock completionHandler)
@@ -1642,11 +1642,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingImageWithHTTPURL)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataWhenDroppingRespectsPresentationStyle)
+TEST(DragAndDropTests, DataTransferGetDataWhenDroppingRespectsPresentationStyle)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     runTestWithTemporaryTextFile(^(NSURL *fileURL) {
         auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
@@ -1672,11 +1672,11 @@ TEST(DataInteractionTests, DataTransferGetDataWhenDroppingRespectsPresentationSt
     });
 }
 
-TEST(DataInteractionTests, DataTransferSetDataCannotWritePlatformTypes)
+TEST(DragAndDropTests, DataTransferSetDataCannotWritePlatformTypes)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"customData = { 'text/plain' : 'foo', 'com.adobe.pdf' : 'try and decode me!' }"];
@@ -1696,11 +1696,11 @@ TEST(DataInteractionTests, DataTransferSetDataCannotWritePlatformTypes)
     });
 }
 
-TEST(DataInteractionTests, DataTransferGetDataReadPlainAndRichText)
+TEST(DragAndDropTests, DataTransferGetDataReadPlainAndRichText)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"DataTransfer"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     NSDictionary *textAttributes = @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:20] };
@@ -1720,11 +1720,11 @@ TEST(DataInteractionTests, DataTransferGetDataReadPlainAndRichText)
     EXPECT_WK_STREQ("", [webView stringByEvaluatingJavaScript:@"files.textContent"]);
 }
 
-TEST(DataInteractionTests, DataTransferSuppressGetDataDueToPresenceOfTextFile)
+TEST(DragAndDropTests, DataTransferSuppressGetDataDueToPresenceOfTextFile)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"DataTransfer"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerObject:@"Hello world" visibility:NSItemProviderRepresentationVisibilityAll];
@@ -1741,11 +1741,11 @@ TEST(DataInteractionTests, DataTransferSuppressGetDataDueToPresenceOfTextFile)
     EXPECT_WK_STREQ("('hello.txt', text/plain)", [webView stringByEvaluatingJavaScript:@"files.textContent"]);
 }
 
-TEST(DataInteractionTests, DataTransferGetDataCannotReadPrivateArbitraryTypes)
+TEST(DragAndDropTests, DataTransferGetDataCannotReadPrivateArbitraryTypes)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     auto itemProvider = adoptNS([[UIItemProvider alloc] init]);
     [itemProvider registerDataRepresentationForTypeIdentifier:(NSString *)kUTTypeMP3 visibility:NSItemProviderRepresentationVisibilityAll loadHandler:^NSProgress *(DataLoadCompletionBlock completionHandler)
@@ -1767,11 +1767,11 @@ TEST(DataInteractionTests, DataTransferGetDataCannotReadPrivateArbitraryTypes)
     });
 }
 
-TEST(DataInteractionTests, DataTransferSetDataValidURL)
+TEST(DragAndDropTests, DataTransferSetDataValidURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"customData = { 'url' : 'https://webkit.org/b/123' }"];
@@ -1804,11 +1804,11 @@ TEST(DataInteractionTests, DataTransferSetDataValidURL)
     TestWebKitAPI::Util::run(&done);
 }
 
-TEST(DataInteractionTests, DataTransferSetDataUnescapedURL)
+TEST(DragAndDropTests, DataTransferSetDataUnescapedURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"customData = { 'url' : 'http://webkit.org/b/\u4F60\u597D;?x=8 + 6' }"];
@@ -1841,11 +1841,11 @@ TEST(DataInteractionTests, DataTransferSetDataUnescapedURL)
     TestWebKitAPI::Util::run(&done);
 }
 
-TEST(DataInteractionTests, DataTransferSetDataInvalidURL)
+TEST(DragAndDropTests, DataTransferSetDataInvalidURL)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"customData = { 'url' : 'some random string' }"];
@@ -1864,11 +1864,11 @@ TEST(DataInteractionTests, DataTransferSetDataInvalidURL)
     });
 }
 
-TEST(DataInteractionTests, DataTransferSanitizeHTML)
+TEST(DragAndDropTests, DataTransferSanitizeHTML)
 {
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
     [webView synchronouslyLoadTestPageNamed:@"dump-datatransfer-types"];
-    auto simulator = adoptNS([[DataInteractionSimulator alloc] initWithWebView:webView.get()]);
+    auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]);
 
     [webView stringByEvaluatingJavaScript:@"select(rich)"];
     [webView stringByEvaluatingJavaScript:@"customData = { 'text/html' : '<meta content=\"secret\">"
@@ -1908,4 +1908,4 @@ TEST(DataInteractionTests, DataTransferSanitizeHTML)
 
 } // namespace TestWebKitAPI
 
-#endif // ENABLE(DATA_INTERACTION)
+#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS) && WK_API_ENABLED
 
 #pragma once
 
-#if ENABLE(DATA_INTERACTION)
+#if ENABLE(DRAG_SUPPORT) && WK_API_ENABLED
 
 #import "TestWKWebView.h"
-#import <UIKit/NSItemProvider+UIKitAdditions.h>
-
-#if USE(APPLE_INTERNAL_SDK)
-#import <UIKit/NSString+UIItemProvider.h>
-#import <UIKit/NSURL+UIItemProvider.h>
-#import <UIKit/UIImage+UIItemProvider.h>
-#import <UIKit/UIItemProvider.h>
-#import <UIKit/UIItemProvider_Private.h>
-#else
-
-@interface NSURL ()
-@property (nonatomic, copy, setter=_setTitle:) NSString *_title;
-@end
-
-#define UIItemProviderRepresentationOptionsVisibilityAll NSItemProviderRepresentationVisibilityAll
-
-@protocol UIItemProviderReading <NSItemProviderReading>
-
-@required
-- (instancetype)initWithItemProviderData:(NSData *)data typeIdentifier:(NSString *)typeIdentifier error:(NSError **)outError;
-
-@end
-
-@protocol UIItemProviderWriting <NSItemProviderWriting>
-
-@required
-- (NSProgress *)loadDataWithTypeIdentifier:(NSString *)typeIdentifier forItemProviderCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
-
-@end
-
-@interface NSAttributedString () <UIItemProviderReading, UIItemProviderWriting>
-@end
-@interface NSString () <UIItemProviderReading, UIItemProviderWriting>
-@end
-@interface NSURL () <UIItemProviderReading, UIItemProviderWriting>
-@end
-@interface UIImage () <UIItemProviderReading, UIItemProviderWriting>
-@end
-
-@interface UIItemProvider : NSItemProvider
-@end
-
-#endif
-
-#import <UIKit/UIKit.h>
 #import <WebKit/WKUIDelegatePrivate.h>
 #import <WebKit/_WKInputDelegate.h>
 #import <wtf/BlockPtr.h>
 
-@class MockDropSession;
-@class MockDragSession;
+#if PLATFORM(IOS)
+#import "UIKitSPI.h"
+#import <UIKit/NSItemProvider+UIKitAdditions.h>
+#endif
+
+typedef NS_ENUM(NSInteger, DragAndDropPhase) {
+    DragAndDropPhaseCancelled = 0,
+    DragAndDropPhaseBeginning = 1,
+    DragAndDropPhaseBegan = 2,
+    DragAndDropPhaseEntered = 3,
+    DragAndDropPhasePerformingDrop = 4
+};
+
+#if PLATFORM(IOS)
+
+typedef NSDictionary<NSNumber *, NSValue *> *ProgressToCGPointValueMap;
 
 @interface MockDragDropSession : NSObject <UIDragDropSession> {
 @private
 @interface MockDragSession : MockDragDropSession <UIDragSession>
 @end
 
-extern NSString * const DataInteractionEnterEventName;
-extern NSString * const DataInteractionOverEventName;
-extern NSString * const DataInteractionPerformOperationEventName;
-extern NSString * const DataInteractionLeaveEventName;
-extern NSString * const DataInteractionStartEventName;
-
-typedef NSDictionary<NSNumber *, NSValue *> *ProgressToCGPointValueMap;
-
-typedef NS_ENUM(NSInteger, DataInteractionPhase) {
-    DataInteractionCancelled = 0,
-    DataInteractionBeginning = 1,
-    DataInteractionBegan = 2,
-    DataInteractionEntered = 3,
-    DataInteractionPerforming = 4
-};
-
 @interface WKWebView (DragAndDropTesting)
 - (id <UIDropInteractionDelegate>)dropInteractionDelegate;
 - (id <UIDragInteractionDelegate>)dragInteractionDelegate;
@@ -118,37 +71,19 @@ typedef NS_ENUM(NSInteger, DataInteractionPhase) {
 - (UIDragInteraction *)dragInteraction;
 @end
 
-@interface DataInteractionSimulator : NSObject<WKUIDelegatePrivate, _WKInputDelegate> {
-@private
-    RetainPtr<TestWKWebView> _webView;
-    RetainPtr<MockDragSession> _dragSession;
-    RetainPtr<MockDropSession> _dropSession;
-    RetainPtr<NSMutableArray> _observedEventNames;
-    RetainPtr<NSArray> _externalItemProviders;
-    RetainPtr<NSArray *> _sourceItemProviders;
-    RetainPtr<NSArray *> _finalSelectionRects;
-    CGPoint _startLocation;
-    CGPoint _endLocation;
-    CGRect _lastKnownDragCaretRect;
-
-    RetainPtr<NSMutableDictionary<NSNumber *, NSValue *>>_remainingAdditionalItemRequestLocationsByProgress;
-    RetainPtr<NSMutableArray<NSValue *>>_queuedAdditionalItemRequestLocations;
-    RetainPtr<NSMutableArray<UITargetedDragPreview *>> _liftPreviews;
-
-    RetainPtr<NSMutableArray<_WKAttachment *>> _insertedAttachments;
-    RetainPtr<NSMutableArray<_WKAttachment *>> _removedAttachments;
-
-    bool _isDoneWaitingForInputSession;
-    double _currentProgress;
-    bool _isDoneWithCurrentRun;
-    DataInteractionPhase _phase;
-
-    RetainPtr<UIDropProposal> _currentDropProposal;
-}
+#endif // PLATFORM(IOS)
+
+@interface DragAndDropSimulator : NSObject<WKUIDelegatePrivate, _WKInputDelegate>
 
 - (instancetype)initWithWebView:(TestWKWebView *)webView;
 // The start location, end location, and locations of additional item requests are all in window coordinates.
 - (void)runFrom:(CGPoint)startLocation to:(CGPoint)endLocation;
+@property (nonatomic, readonly) NSArray<_WKAttachment *> *insertedAttachments;
+@property (nonatomic, readonly) NSArray<_WKAttachment *> *removedAttachments;
+@property (nonatomic, readonly) DragAndDropPhase phase;
+
+#if PLATFORM(IOS)
+
 - (void)runFrom:(CGPoint)startLocation to:(CGPoint)endLocation additionalItemRequestLocations:(ProgressToCGPointValueMap)additionalItemRequestLocations;
 - (void)waitForInputSession;
 - (void)endDataTransfer;
@@ -160,19 +95,17 @@ typedef NS_ENUM(NSInteger, DataInteractionPhase) {
 @property (nonatomic) BlockPtr<NSArray *(UIItemProvider *, NSArray *, NSDictionary *)> convertItemProvidersBlock;
 @property (nonatomic) BlockPtr<NSArray *(id <UIDropSession>)> overridePerformDropBlock;
 @property (nonatomic, strong) NSArray *externalItemProviders;
-@property (nonatomic) BlockPtr<NSUInteger(NSUInteger, id)> overrideDataInteractionOperationBlock;
-@property (nonatomic) BlockPtr<void(BOOL, NSArray *)> dataInteractionOperationCompletionBlock;
+@property (nonatomic) BlockPtr<NSUInteger(NSUInteger, id)> overrideDragUpdateBlock;
+@property (nonatomic) BlockPtr<void(BOOL, NSArray *)> dropCompletionBlock;
 
 @property (nonatomic, readonly) NSArray *sourceItemProviders;
 @property (nonatomic, readonly) NSArray *observedEventNames;
 @property (nonatomic, readonly) NSArray *finalSelectionRects;
-@property (nonatomic, readonly) DataInteractionPhase phase;
 @property (nonatomic, readonly) CGRect lastKnownDragCaretRect;
 @property (nonatomic, readonly) NSArray<UITargetedDragPreview *> *liftPreviews;
 
-@property (nonatomic, readonly) NSArray<_WKAttachment *> *insertedAttachments;
-@property (nonatomic, readonly) NSArray<_WKAttachment *> *removedAttachments;
+#endif // PLATFORM(IOS)
 
 @end
 
-#endif // ENABLE(DATA_INTERACTION)
+#endif // ENABLE(DRAG_SUPPORT) && WK_API_ENABLED
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "DataInteractionSimulator.h"
+#include "DragAndDropSimulator.h"
 
-#if ENABLE(DATA_INTERACTION)
+#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS) && WK_API_ENABLED
 
 #import "InstanceMethodSwizzler.h"
 #import "PlatformUtilities.h"
@@ -169,12 +169,6 @@ using namespace TestWebKitAPI;
 
 @end
 
-NSString * const DataInteractionEnterEventName = @"dragenter";
-NSString * const DataInteractionOverEventName = @"dragover";
-NSString * const DataInteractionPerformOperationEventName = @"drop";
-NSString * const DataInteractionLeaveEventName = @"dragleave";
-NSString * const DataInteractionStartEventName = @"dragstart";
-
 @implementation MockDropSession
 
 - (instancetype)initWithProviders:(NSArray<UIItemProvider *> *)providers location:(CGPoint)locationInWindow window:(UIWindow *)window allowMove:(BOOL)allowMove
@@ -277,27 +271,52 @@ static double progressIncrementStep = 0.033;
 static double progressTimeStep = 0.016;
 static NSString *TestWebKitAPISimulateCancelAllTouchesNotificationName = @"TestWebKitAPISimulateCancelAllTouchesNotificationName";
 
-static NSArray *dataInteractionEventNames()
+static NSArray *dragAndDropEventNames()
 {
     static NSArray *eventNames = nil;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^() {
-        eventNames = @[ DataInteractionEnterEventName, DataInteractionOverEventName, DataInteractionPerformOperationEventName, DataInteractionLeaveEventName, DataInteractionStartEventName ];
+        eventNames = @[ @"dragenter", @"dragover", @"drop", @"dragleave", @"dragstart" ];
     });
     return eventNames;
 }
 
-@interface DataInteractionSimulatorApplication : UIApplication
+@interface DragAndDropSimulatorApplication : UIApplication
 @end
 
-@implementation DataInteractionSimulatorApplication
+@implementation DragAndDropSimulatorApplication
 - (void)_cancelAllTouches
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:TestWebKitAPISimulateCancelAllTouchesNotificationName object:nil];
 }
 @end
 
-@implementation DataInteractionSimulator
+@implementation DragAndDropSimulator {
+    RetainPtr<TestWKWebView> _webView;
+    RetainPtr<MockDragSession> _dragSession;
+    RetainPtr<MockDropSession> _dropSession;
+    RetainPtr<NSMutableArray> _observedEventNames;
+    RetainPtr<NSArray> _externalItemProviders;
+    RetainPtr<NSArray *> _sourceItemProviders;
+    RetainPtr<NSArray *> _finalSelectionRects;
+    CGPoint _startLocation;
+    CGPoint _endLocation;
+    CGRect _lastKnownDragCaretRect;
+
+    RetainPtr<NSMutableDictionary<NSNumber *, NSValue *>>_remainingAdditionalItemRequestLocationsByProgress;
+    RetainPtr<NSMutableArray<NSValue *>>_queuedAdditionalItemRequestLocations;
+    RetainPtr<NSMutableArray<UITargetedDragPreview *>> _liftPreviews;
+
+    RetainPtr<NSMutableArray<_WKAttachment *>> _insertedAttachments;
+    RetainPtr<NSMutableArray<_WKAttachment *>> _removedAttachments;
+
+    bool _isDoneWaitingForInputSession;
+    double _currentProgress;
+    bool _isDoneWithCurrentRun;
+    DragAndDropPhase _phase;
+
+    RetainPtr<UIDropProposal> _currentDropProposal;
+}
 
 - (instancetype)initWithWebView:(TestWKWebView *)webView
 {
@@ -325,7 +344,7 @@ static NSArray *dataInteractionEventNames()
 
 - (void)_resetSimulatedState
 {
-    _phase = DataInteractionBeginning;
+    _phase = DragAndDropPhaseBeginning;
     _currentProgress = 0;
     _isDoneWithCurrentRun = false;
     _observedEventNames = adoptNS([[NSMutableArray alloc] init]);
@@ -349,7 +368,7 @@ static NSArray *dataInteractionEventNames()
 - (void)simulateAllTouchesCanceled:(NSNotification *)notification
 {
     [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_advanceProgress) object:nil];
-    _phase = DataInteractionCancelled;
+    _phase = DragAndDropPhaseCancelled;
     _currentProgress = 1;
     _isDoneWithCurrentRun = true;
     if (_dragSession)
@@ -367,18 +386,16 @@ static NSArray *dataInteractionEventNames()
     [defaultCenter addObserver:self selector:@selector(simulateAllTouchesCanceled:) name:TestWebKitAPISimulateCancelAllTouchesNotificationName object:nil];
 
     if (_shouldEnsureUIApplication)
-        UIApplicationInstantiateSingleton([DataInteractionSimulatorApplication class]);
+        UIApplicationInstantiateSingleton([DragAndDropSimulatorApplication class]);
 
     [self _resetSimulatedState];
 
     if (additionalItemRequestLocations)
         _remainingAdditionalItemRequestLocationsByProgress = adoptNS([additionalItemRequestLocations mutableCopy]);
 
-    RetainPtr<DataInteractionSimulator> strongSelf = self;
-    for (NSString *eventName in dataInteractionEventNames()) {
-        DataInteractionSimulator *weakSelf = strongSelf.get();
-        [weakSelf->_webView performAfterReceivingMessage:eventName action:^() {
-            [weakSelf->_observedEventNames addObject:eventName];
+    for (NSString *eventName in dragAndDropEventNames()) {
+        [_webView performAfterReceivingMessage:eventName action:[strongSelf = retainPtr(self), name = retainPtr(eventName)] {
+            [strongSelf->_observedEventNames addObject:name.get()];
         }];
     }
 
@@ -387,23 +404,22 @@ static NSArray *dataInteractionEventNames()
 
     if (self.externalItemProviders.count) {
         _dropSession = adoptNS([[MockDropSession alloc] initWithProviders:self.externalItemProviders location:_startLocation window:[_webView window] allowMove:self.shouldAllowMoveOperation]);
-        _phase = DataInteractionBegan;
+        _phase = DragAndDropPhaseBegan;
         [self _advanceProgress];
     } else {
         _dragSession = adoptNS([[MockDragSession alloc] initWithWindow:[_webView window] allowMove:self.shouldAllowMoveOperation]);
         [_dragSession setMockLocationInWindow:_startLocation];
-        [(id <UIDragInteractionDelegate_ForWebKitOnly>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] prepareForSession:_dragSession.get() completion:^() {
-            DataInteractionSimulator *weakSelf = strongSelf.get();
-            if (weakSelf->_phase == DataInteractionCancelled)
+        [(id <UIDragInteractionDelegate_ForWebKitOnly>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] prepareForSession:_dragSession.get() completion:[strongSelf = retainPtr(self)] {
+            if (strongSelf->_phase == DragAndDropPhaseCancelled)
                 return;
 
-            weakSelf->_phase = DataInteractionBeginning;
-            [weakSelf _advanceProgress];
+            strongSelf->_phase = DragAndDropPhaseBeginning;
+            [strongSelf _advanceProgress];
         }];
     }
 
     Util::run(&_isDoneWithCurrentRun);
-    [_webView clearMessageHandlers:dataInteractionEventNames()];
+    [_webView clearMessageHandlers:dragAndDropEventNames()];
     _finalSelectionRects = [_webView selectionRectsAfterPresentationUpdate];
 
     [defaultCenter removeObserver:self];
@@ -414,16 +430,16 @@ static NSArray *dataInteractionEventNames()
     return _finalSelectionRects.get();
 }
 
-- (void)_concludeDataInteractionAndPerformOperationIfNecessary
+- (void)_concludeDropAndPerformOperationIfNecessary
 {
     _lastKnownDragCaretRect = [_webView _dragCaretRect];
     auto operation = [_currentDropProposal operation];
     if (operation != UIDropOperationCancel && operation != UIDropOperationForbidden) {
         [[_webView dropInteractionDelegate] dropInteraction:[_webView dropInteraction] performDrop:_dropSession.get()];
-        _phase = DataInteractionPerforming;
+        _phase = DragAndDropPhasePerformingDrop;
     } else {
         _isDoneWithCurrentRun = YES;
-        _phase = DataInteractionCancelled;
+        _phase = DragAndDropPhaseCancelled;
     }
 
     [[_webView dropInteractionDelegate] dropInteraction:[_webView dropInteraction] sessionDidEnd:_dropSession.get()];
@@ -479,16 +495,16 @@ static NSArray *dataInteractionEventNames()
 
     if (_currentProgress >= 1) {
         _currentProgress = 1;
-        [self _concludeDataInteractionAndPerformOperationIfNecessary];
+        [self _concludeDropAndPerformOperationIfNecessary];
         return;
     }
 
     switch (_phase) {
-    case DataInteractionBeginning: {
+    case DragAndDropPhaseBeginning: {
         NSMutableArray<UIItemProvider *> *itemProviders = [NSMutableArray array];
         NSArray *items = [[_webView dragInteractionDelegate] dragInteraction:[_webView dragInteraction] itemsForBeginningSession:_dragSession.get()];
         if (!items.count) {
-            _phase = DataInteractionCancelled;
+            _phase = DragAndDropPhaseCancelled;
             _currentProgress = 1;
             _isDoneWithCurrentRun = true;
             return;
@@ -519,14 +535,14 @@ static NSArray *dataInteractionEventNames()
             [retainedWebView resignFirstResponder];
         });
 
-        _phase = DataInteractionBegan;
+        _phase = DragAndDropPhaseBegan;
         break;
     }
-    case DataInteractionBegan:
+    case DragAndDropPhaseBegan:
         [[_webView dropInteractionDelegate] dropInteraction:[_webView dropInteraction] sessionDidEnter:_dropSession.get()];
-        _phase = DataInteractionEntered;
+        _phase = DragAndDropPhaseEntered;
         break;
-    case DataInteractionEntered: {
+    case DragAndDropPhaseEntered: {
         _currentDropProposal = [[_webView dropInteractionDelegate] dropInteraction:[_webView dropInteraction] sessionDidUpdate:_dropSession.get()];
         if (![self shouldAllowMoveOperation] && [_currentDropProposal operation] == UIDropOperationMove)
             _currentDropProposal = adoptNS([[UIDropProposal alloc] initWithDropOperation:UIDropOperationCancel]);
@@ -567,7 +583,7 @@ static NSArray *dataInteractionEventNames()
     _externalItemProviders = adoptNS([externalItemProviders copy]);
 }
 
-- (DataInteractionPhase)phase
+- (DragAndDropPhase)phase
 {
     return _phase;
 }
@@ -613,13 +629,13 @@ static NSArray *dataInteractionEventNames()
 {
     _isDoneWithCurrentRun = true;
 
-    if (self.dataInteractionOperationCompletionBlock)
-        self.dataInteractionOperationCompletionBlock(handled, itemProviders);
+    if (self.dropCompletionBlock)
+        self.dropCompletionBlock(handled, itemProviders);
 }
 
 - (NSUInteger)_webView:(WKWebView *)webView willUpdateDataInteractionOperationToOperation:(NSUInteger)operation forSession:(id)session
 {
-    return self.overrideDataInteractionOperationBlock ? self.overrideDataInteractionOperationBlock(operation, session) : operation;
+    return self.overrideDragUpdateBlock ? self.overrideDragUpdateBlock(operation, session) : operation;
 }
 
 - (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProvidersForItemProvider:(UIItemProvider *)itemProvider representingObjects:(NSArray *)representingObjects additionalData:(NSDictionary *)additionalData
@@ -632,12 +648,10 @@ static NSArray *dataInteractionEventNames()
     if (!self.showCustomActionSheetBlock)
         return NO;
 
-    RetainPtr<DataInteractionSimulator> strongSelf = self;
-    dispatch_async(dispatch_get_main_queue(), ^() {
-        DataInteractionSimulator *weakSelf = strongSelf.get();
-        [[weakSelf->_webView dragInteractionDelegate] dragInteraction:[weakSelf->_webView dragInteraction] sessionWillBegin:weakSelf->_dragSession.get()];
-        weakSelf->_phase = DataInteractionBegan;
-        [weakSelf _scheduleAdvanceProgress];
+    dispatch_async(dispatch_get_main_queue(), [strongSelf = retainPtr(self)] {
+        [[strongSelf->_webView dragInteractionDelegate] dragInteraction:[strongSelf->_webView dragInteraction] sessionWillBegin:strongSelf->_dragSession.get()];
+        strongSelf->_phase = DragAndDropPhaseBegan;
+        [strongSelf _scheduleAdvanceProgress];
     });
 
     return self.showCustomActionSheetBlock(element);
@@ -672,4 +686,4 @@ static NSArray *dataInteractionEventNames()
 
 @end
 
-#endif // ENABLE(DATA_INTERACTION)
+#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS) && WK_API_ENABLED
index 8edd052..8ecf305 100644 (file)
 @protocol UIDragSession;
 @class UIDragInteraction;
 @class UIDragItem;
+#import <UIKit/NSString+UIItemProvider.h>
+#import <UIKit/NSURL+UIItemProvider.h>
 #import <UIKit/UIDragInteraction_Private.h>
+#import <UIKit/UIImage+UIItemProvider.h>
+#import <UIKit/UIItemProvider.h>
+#import <UIKit/UIItemProvider_Private.h>
 #endif // ENABLE(DRAG_SUPPORT)
 
 #else
@@ -70,6 +75,42 @@ WTF_EXTERN_C_END
 - (void)handleKeyWebEvent:(WebEvent *)theEvent withCompletionHandler:(void (^)(WebEvent *, BOOL))completionHandler;
 @end
 
+#if ENABLE(DRAG_SUPPORT)
+
+@interface NSURL ()
+@property (nonatomic, copy, setter=_setTitle:) NSString *_title;
+@end
+
+#define UIItemProviderRepresentationOptionsVisibilityAll NSItemProviderRepresentationVisibilityAll
+
+@protocol UIItemProviderReading <NSItemProviderReading>
+
+@required
+- (instancetype)initWithItemProviderData:(NSData *)data typeIdentifier:(NSString *)typeIdentifier error:(NSError **)outError;
+
+@end
+
+@protocol UIItemProviderWriting <NSItemProviderWriting>
+
+@required
+- (NSProgress *)loadDataWithTypeIdentifier:(NSString *)typeIdentifier forItemProviderCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
+
+@end
+
+@interface NSAttributedString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface NSString () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface NSURL () <UIItemProviderReading, UIItemProviderWriting>
+@end
+@interface UIImage () <UIItemProviderReading, UIItemProviderWriting>
+@end
+
+@interface UIItemProvider : NSItemProvider
+@end
+
+#endif
+
 #endif
 
 @protocol UITextInputTraits_Private_Proposed_SPI_34583628 <UITextInputPrivate>
diff --git a/Tools/TestWebKitAPI/mac/DragAndDropSimulatorMac.mm b/Tools/TestWebKitAPI/mac/DragAndDropSimulatorMac.mm
new file mode 100644 (file)
index 0000000..9a7918c
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DragAndDropSimulator.h"
+
+#if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC) && WK_API_ENABLED
+
+#import "TestWKWebView.h"
+
+@implementation DragAndDropSimulator {
+    RetainPtr<TestWKWebView> _webView;
+}
+
+- (instancetype)initWithWebView:(TestWKWebView *)webView
+{
+    if (self = [super init]) {
+        _webView = webView;
+        [_webView setUIDelegate:self];
+        [_webView _setInputDelegate:self];
+    }
+    return self;
+}
+
+- (void)dealloc
+{
+    if ([_webView UIDelegate] == self)
+        [_webView setUIDelegate:nil];
+
+    if ([_webView _inputDelegate] == self)
+        [_webView _setInputDelegate:nil];
+
+    [super dealloc];
+}
+
+- (void)runFrom:(CGPoint)startLocation to:(CGPoint)endLocation
+{
+    // FIXME: Add a mechanism to simulate dragging on macOS.
+    UNUSED_PARAM(startLocation);
+    UNUSED_PARAM(endLocation);
+}
+
+- (NSArray<_WKAttachment *> *)insertedAttachments
+{
+    return @[ ];
+}
+
+- (NSArray<_WKAttachment *> *)removedAttachments
+{
+    return @[ ];
+}
+
+- (DragAndDropPhase)phase
+{
+    return DragAndDropPhaseCancelled;
+}
+
+@end
+
+#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(MAC) && WK_API_ENABLED