Add a unit test covering <https://trac.webkit.org/changeset/205983>
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 01:02:40 +0000 (01:02 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 01:02:40 +0000 (01:02 +0000)
commit0717c9d68944c988dccbb381daaab29fead722a7
treeb5ce8345ecc316db57af4fbae95e3826852faa18
parent73f91d6d4980b6bd101a30f65064d31b801f43cc
Add a unit test covering <https://trac.webkit.org/changeset/205983>
https://bugs.webkit.org/show_bug.cgi?id=162112

Reviewed by Beth Dakin.

Source/WebKit2:

Adds some a test support method as SPI on WKWebView to determine whether to request candidates. See
Tools/ChangeLog for more details.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _shouldRequestCandidates]):
(-[WKWebView _forceRequestCandidates]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

Adds a new unit test covering the changes in r205983 along with the infrastructure needed to support it. Also
further refactors the TestWKWebView used by VideoControlsManager and WKWebViewCandidateTests so that in both
cases, we add the WKWebView to a visible key window, and when sending a mouse down event, we propagate the event
at the window level rather than the view level, allowing greater flexibility to simulate behaviors such as
pressure-sensitive events that are needed for the new test.

Also rewrites currently disabled unit tests in CandidateTests as WebKit2 unit tests in WKWebViewCandidateTests,
checking whether or not to should be requesting candidates in password and non-password fields.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(TestWebKitAPI::setUpWebViewForTestingVideoControlsManager):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm:
(-[CandidateTestWebView typeString:inputMessage:]):
(+[CandidateTestWebView setUpWithFrame:testPage:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/large-input-field-focus-onload.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/text-and-password-inputs.html: Added.
* TestWebKitAPI/mac/TestWKWebViewMac.h:
* TestWebKitAPI/mac/TestWKWebViewMac.mm:
(__simulated_forceClickAssociatedEventsMask):
(-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebView initWithFrame:]):
(-[TestWKWebView initWithFrame:configuration:]):
(-[TestWKWebView _setUpTestWindow:]):
(-[TestWKWebView mouseDownAtPoint:simulatePressure:]):
(-[TestWKWebView typeCharacter:]):
(-[TestWKWebView mouseDownAtPoint:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-input-field-focus-onload.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/text-and-password-inputs.html [new file with mode: 0644]
Tools/TestWebKitAPI/mac/TestWKWebViewMac.h
Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm