Changeset 246657 in webkit
- Timestamp:
- Jun 20, 2019 3:28:47 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r246639 r246657 1 2019-06-20 Alex Christensen <achristensen@webkit.org> 2 3 Add unit test for UIContextMenuConfiguration API 4 https://bugs.webkit.org/show_bug.cgi?id=199043 5 6 Reviewed by Wenson Hsieh. 7 8 * UIProcess/API/APIPageConfiguration.cpp: 9 (API::PageConfiguration::copy const): 10 * UIProcess/API/APIPageConfiguration.h: 11 (API::PageConfiguration::clickInteractionDriverForTesting const): 12 (API::PageConfiguration::setClickInteractionDriverForTesting): 13 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 14 (-[WKWebViewConfiguration _setClickInteractionDriverForTesting:]): 15 (-[WKWebViewConfiguration _clickInteractionDriverForTesting]): 16 * UIProcess/ios/WKContentViewInteraction.mm: 17 (-[WKContentView _registerPreview]): 18 1 19 2019-06-20 Alexander Mikhaylenko <exalm7659@gmail.com> 2 20 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r246583 r246657 1191 1191 @property (nonatomic, copy) UIContextMenuActionProvider actionProvider; 1192 1192 @end 1193 1194 @protocol _UIClickInteractionDriverDelegate; 1195 @protocol _UIClickInteractionDriving <NSObject> 1196 @property (nonatomic, weak) id <_UIClickInteractionDriverDelegate> delegate; 1197 @end 1198 1199 @class _UIClickPresentationInteraction; 1200 @interface UIContextMenuInteraction (Radar51288435) 1201 @property (nonatomic, strong) _UIClickPresentationInteraction *presentationInteraction; 1202 @end 1203 1204 @interface _UIClickInteraction : NSObject <UIInteraction> 1205 @end 1206 1207 @interface _UIClickPresentationInteraction : NSObject <UIInteraction> 1208 @end 1209 @interface _UIClickPresentationInteraction (NeededUntil51288435Fixed) 1210 @property (nonatomic, strong) _UIClickInteraction *previewClickInteraction; 1211 @end 1212 1213 @interface _UIClickInteraction (Radar51288435) 1214 @property (nonatomic, strong) id<_UIClickInteractionDriving> driver; 1215 @end 1216 1193 1217 #endif 1194 1218 -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
r245183 r246657 74 74 copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority; 75 75 copy->m_canShowWhileLocked = this->m_canShowWhileLocked; 76 copy->m_clickInteractionDriverForTesting = this->m_clickInteractionDriverForTesting; 76 77 #endif 77 78 copy->m_initialCapitalizationEnabled = this->m_initialCapitalizationEnabled; -
trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h
r245183 r246657 31 31 #include <wtf/Forward.h> 32 32 #include <wtf/GetPtr.h> 33 34 #if PLATFORM(IOS_FAMILY) 35 OBJC_PROTOCOL(_UIClickInteractionDriving); 36 #include <wtf/RetainPtr.h> 37 #endif 33 38 34 39 namespace WebKit { … … 99 104 bool canShowWhileLocked() const { return m_canShowWhileLocked; } 100 105 void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; } 106 107 const RetainPtr<_UIClickInteractionDriving>& clickInteractionDriverForTesting() const { return m_clickInteractionDriverForTesting; } 108 void setClickInteractionDriverForTesting(RetainPtr<_UIClickInteractionDriving>&& driver) { m_clickInteractionDriverForTesting = WTFMove(driver); } 101 109 #endif 102 110 bool initialCapitalizationEnabled() { return m_initialCapitalizationEnabled; } … … 152 160 bool m_alwaysRunsAtForegroundPriority { false }; 153 161 bool m_canShowWhileLocked { false }; 162 RetainPtr<_UIClickInteractionDriving> m_clickInteractionDriverForTesting; 154 163 #endif 155 164 bool m_initialCapitalizationEnabled { true }; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r246236 r246657 792 792 } 793 793 794 - (void)_setClickInteractionDriverForTesting:(id<_UIClickInteractionDriving>)driver 795 { 796 _pageConfiguration->setClickInteractionDriverForTesting((NSObject<_UIClickInteractionDriving> *)driver); 797 } 798 799 - (id <_UIClickInteractionDriving>)_clickInteractionDriverForTesting 800 { 801 return _pageConfiguration->clickInteractionDriverForTesting().get(); 802 } 803 794 804 #endif // PLATFORM(IOS_FAMILY) 795 805 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
r245294 r246657 34 34 _WKDragLiftDelayLong 35 35 } WK_API_AVAILABLE(ios(11.0)); 36 37 @protocol _UIClickInteractionDriving; 36 38 #endif 37 39 … … 85 87 @property (nonatomic, setter=_setShouldDecidePolicyBeforeLoadingQuickLookPreview:) BOOL _shouldDecidePolicyBeforeLoadingQuickLookPreview WK_API_AVAILABLE(ios(WK_IOS_TBA)); 86 88 @property (nonatomic, setter=_setCanShowWhileLocked:) BOOL _canShowWhileLocked WK_API_AVAILABLE(ios(WK_IOS_TBA)); 89 @property (nonatomic, setter=_setClickInteractionDriverForTesting:) id <_UIClickInteractionDriving> _clickInteractionDriverForTesting WK_API_AVAILABLE(ios(WK_IOS_TBA)); 87 90 #else 88 91 @property (nonatomic, setter=_setShowsURLsInToolTips:) BOOL _showsURLsInToolTips WK_API_AVAILABLE(macos(10.12)); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r246626 r246657 7435 7435 [self addInteraction:_contextMenuInteraction.get()]; 7436 7436 7437 if (id<_UIClickInteractionDriving> driver = _webView.configuration._clickInteractionDriverForTesting) { 7438 _UIClickInteraction *previewClickInteraction = [[_contextMenuInteraction presentationInteraction] previewClickInteraction]; 7439 [previewClickInteraction setDriver:driver]; 7440 [driver setDelegate:(id<_UIClickInteractionDriverDelegate>)previewClickInteraction]; 7441 } 7442 7437 7443 [self _showLinkPreviewsPreferenceChanged:nil]; 7438 7444 -
trunk/Tools/ChangeLog
r246656 r246657 1 2019-06-20 Alex Christensen <achristensen@webkit.org> 2 3 Add unit test for UIContextMenuConfiguration API 4 https://bugs.webkit.org/show_bug.cgi?id=199043 5 6 Reviewed by Wenson Hsieh. 7 8 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 9 * TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm: Added. 10 (-[TestContextMenuUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]): 11 (-[TestContextMenuUIDelegate webView:contextMenuWillPresentForElement:]): 12 (-[TestContextMenuUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]): 13 (-[TestContextMenuUIDelegate webView:contextMenuDidEndForElement:]): 14 (TEST): 15 * TestWebKitAPI/cocoa/TestContextMenuDriver.h: Added. 16 * TestWebKitAPI/cocoa/TestContextMenuDriver.mm: Added. 17 (-[TestContextMenuDriver delegate]): 18 (-[TestContextMenuDriver setDelegate:]): 19 (-[TestContextMenuDriver view]): 20 (-[TestContextMenuDriver setView:]): 21 (-[TestContextMenuDriver allowableMovement]): 22 (-[TestContextMenuDriver setAllowableMovement:]): 23 (-[TestContextMenuDriver primaryGestureRecognizer]): 24 (-[TestContextMenuDriver setPrimaryGestureRecognizer:]): 25 (-[TestContextMenuDriver touchDuration]): 26 (-[TestContextMenuDriver setTouchDuration:]): 27 (-[TestContextMenuDriver locationInCoordinateSpace:]): 28 (-[TestContextMenuDriver cancelInteraction]): 29 (-[TestContextMenuDriver begin:]): 30 (-[TestContextMenuDriver clickDown]): 31 (-[TestContextMenuDriver clickUp]): 32 (-[TestContextMenuDriver end]): 33 * TestWebKitAPI/ios/UIKitSPI.h: 34 1 35 2019-06-20 Aakash Jain <aakash_jain@apple.com> 2 36 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r246623 r246657 320 320 5C2936931D5BF70D00DEAB1E /* CookieAcceptPolicy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */; }; 321 321 5C2936961D5C00ED00DEAB1E /* CookieMessage.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C2936941D5BFD1900DEAB1E /* CookieMessage.html */; }; 322 5C3B1D2622A74F6700BCF4D0 /* ContextMenus.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C3B1D2522A74EA400BCF4D0 /* ContextMenus.mm */; }; 322 323 5C4259462266A68A0039AA7A /* BasicProposedCredentialPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C42594422669E9B0039AA7A /* BasicProposedCredentialPlugIn.mm */; }; 323 324 5C4A84951F7EEFFC00ACFC54 /* Configuration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C4A84941F7EEFD400ACFC54 /* Configuration.mm */; }; … … 350 351 5CCB10E4213457E000AC5AF0 /* ShouldGoToBackForwardListItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CCB10DF2134579D00AC5AF0 /* ShouldGoToBackForwardListItem.mm */; }; 351 352 5CE354D91E70DA5C00BEFE3B /* WKContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */; }; 353 5CE7594922A883D200C12409 /* TestContextMenuDriver.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE7594722A883A500C12409 /* TestContextMenuDriver.mm */; }; 352 354 5CEAB5E11FA939F400A77FAA /* _WKInputDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */; }; 353 355 5CF540E92257E67C00E6BC0E /* DownloadThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CF540E82257E64B00E6BC0E /* DownloadThread.mm */; }; … … 1768 1770 5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieAcceptPolicy.mm; sourceTree = "<group>"; }; 1769 1771 5C2936941D5BFD1900DEAB1E /* CookieMessage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = CookieMessage.html; sourceTree = "<group>"; }; 1772 5C3B1D2522A74EA400BCF4D0 /* ContextMenus.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenus.mm; sourceTree = "<group>"; }; 1770 1773 5C42594422669E9B0039AA7A /* BasicProposedCredentialPlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BasicProposedCredentialPlugIn.mm; sourceTree = "<group>"; }; 1771 1774 5C4A84941F7EEFD400ACFC54 /* Configuration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Configuration.mm; sourceTree = "<group>"; }; … … 1799 1802 5CCB10E02134579D00AC5AF0 /* ResponsivenessTimer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResponsivenessTimer.mm; sourceTree = "<group>"; }; 1800 1803 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContentExtensionStore.mm; sourceTree = "<group>"; }; 1804 5CE7594722A883A500C12409 /* TestContextMenuDriver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestContextMenuDriver.mm; path = cocoa/TestContextMenuDriver.mm; sourceTree = "<group>"; }; 1805 5CE7594822A883A500C12409 /* TestContextMenuDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestContextMenuDriver.h; path = cocoa/TestContextMenuDriver.h; sourceTree = "<group>"; }; 1801 1806 5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInputDelegate.mm; sourceTree = "<group>"; }; 1802 1807 5CF540E82257E64B00E6BC0E /* DownloadThread.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadThread.mm; sourceTree = "<group>"; }; … … 2540 2545 F44A531021B8976900DBB99C /* InstanceMethodSwizzler.mm */, 2541 2546 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */, 2547 5CE7594822A883A500C12409 /* TestContextMenuDriver.h */, 2548 5CE7594722A883A500C12409 /* TestContextMenuDriver.mm */, 2542 2549 2D1C04A51D76298B000A6816 /* TestNavigationDelegate.h */, 2543 2550 2D1C04A61D76298B000A6816 /* TestNavigationDelegate.mm */, … … 2616 2623 A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */, 2617 2624 5CA1DED81F74A87100E71BD3 /* ContentRuleListNotification.mm */, 2625 5C3B1D2522A74EA400BCF4D0 /* ContextMenus.mm */, 2618 2626 5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */, 2619 2627 5C19A5231FD0F32600EEA323 /* CookiePrivateBrowsing.mm */, … … 4171 4179 8349D3C21DB96DDE004A9F65 /* ContextMenuDownload.mm in Sources */, 4172 4180 CD0BD0A61F79924D001AB2CF /* ContextMenuImgWithVideo.mm in Sources */, 4181 5C3B1D2622A74F6700BCF4D0 /* ContextMenus.mm in Sources */, 4173 4182 5C2936931D5BF70D00DEAB1E /* CookieAcceptPolicy.mm in Sources */, 4174 4183 51D1249B1E785425002B2820 /* CookieManager.cpp in Sources */, … … 4474 4483 7CCE7F161A411AE600447C4C /* TerminateTwice.cpp in Sources */, 4475 4484 7CCE7EA91A411A1D00447C4C /* TestBrowsingContextLoadDelegate.mm in Sources */, 4485 5CE7594922A883D200C12409 /* TestContextMenuDriver.mm in Sources */, 4476 4486 F46128CB211D475100D9FADB /* TestDraggingInfo.mm in Sources */, 4477 4487 F4E0A2B82122847400AF7C7F /* TestFilePromiseReceiver.mm in Sources */, -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r245998 r246657 200 200 @end 201 201 202 typedef NS_ENUM(NSUInteger, _UIClickInteractionEvent) { 203 _UIClickInteractionEventBegan = 0, 204 _UIClickInteractionEventClickedDown, 205 _UIClickInteractionEventClickedUp, 206 _UIClickInteractionEventEnded, 207 _UIClickInteractionEventCount 208 }; 209 210 @protocol _UIClickInteractionDriving; 211 @protocol _UIClickInteractionDriverDelegate <NSObject> 212 - (void)clickDriver:(id<_UIClickInteractionDriving>)driver shouldBegin:(void(^)(BOOL))completion; 213 - (void)clickDriver:(id<_UIClickInteractionDriving>)driver didPerformEvent:(_UIClickInteractionEvent)event; 214 @optional 215 - (void)clickDriver:(id<_UIClickInteractionDriving>)driver didUpdateHighlightProgress:(CGFloat)progress; 216 - (BOOL)clickDriver:(id<_UIClickInteractionDriving>)driver shouldDelayGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer; 217 @end 218 202 219 #endif // PLATFORM(IOS) 203 220
Note: See TracChangeset
for help on using the changeset viewer.