Make it possible to test iOS select elements, and add iPhone and iPad tests for them
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Aug 2016 22:15:47 +0000 (22:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Aug 2016 22:15:47 +0000 (22:15 +0000)
commitb1f2af78a4ae1a78ef8fb2bd0fa0d9e546af9d13
tree317a71cc17104f9669b291e4c8f3bab951e3d1bd
parentc726a7ec8a76f703494510368d322e83c03348b7
Make it possible to test iOS select elements, and add iPhone and iPad tests for them
https://bugs.webkit.org/show_bug.cgi?id=160909

Reviewed by Enrica Casucci.

Source/WebKit2:

Hook up form-related UIScriptController functions, and plumb through the various
<select> pickers the ability to select a row.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dismissFormAccessoryView]):
(-[WKWebView selectFormAccessoryPickerRow:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView selectFormAccessoryPickerRow:]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl selectRow:inComponent:extendingSelection:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker selectRow:inComponent:extendingSelection:]):
(-[WKSelectSinglePicker selectRow:inComponent:extendingSelection:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover selectRow:inComponent:extendingSelection:]):

Tools:

Add functions to UIScriptController to dismiss the form accessory view for iOS,
and to programmatically pick a row from a <select> picker.

* WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:
* WebKitTestRunner/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::dismissFormAccessoryView):
(WTR::UIScriptController::selectFormAccessoryPickerRow):
* WebKitTestRunner/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::dismissFormAccessoryView):
(WTR::UIScriptController::selectFormAccessoryPickerRow):

LayoutTests:

Add iPhone and iPad tests for the <select> pickers. The iPhone test has to
use a didShowKeyboardCallback to know when to select the appropriate row,
and to dismiss the picker. The iPad test can just select the row, which also
dismisses the popover.

* fast/forms/ios/choose-select-option-expected.txt: Added.
* fast/forms/ios/choose-select-option.html: Added.
* fast/forms/ios/ipad/choose-select-option-expected.txt: Added.
* fast/forms/ios/ipad/choose-select-option.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/ios/choose-select-option-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ios/choose-select-option.html [new file with mode: 0644]
LayoutTests/fast/forms/ios/ipad/choose-select-option-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ios/ipad/choose-select-option.html [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h
Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.mm
Source/WebKit2/UIProcess/ios/forms/WKFormSelectPicker.mm
Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm
Tools/ChangeLog
Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl
Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp
Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm