[webkit-dev] Use LayoutTests/resources/ui-helper.js to tap or click an element regardless of platform

Ryosuke Niwa rniwa at webkit.org
Tue Dec 13 22:55:37 PST 2016


Hi,

I added a little helper class called UIHelper in
https://trac.webkit.org/changeset/209780 to provide an abstraction around
eventSender and UIScriptController so that you can trigger a click or a tap
at a specified coordinate without having to worry about which platform
you’re on.

This is useful if the only thing you’re trying to do is to activate some
element (e.g. hyperlink, click event handler, etc…) in both DumpRenderTree
and WebKitTestRunner on both macOS and iOS.

*Background*: iOS WebKit2 port doesn’t have eventSender due to its
architecture.  As a result, we have UIScriptController which executes
JavaScript in the UIProcess to trigger key events and touch there.
However, Mac port’s WebKitTestRunner doesn’t support tap (due to the lack
of support for touch events).  Furthermore, UIScriptController isn’t
available in DumpRenderTree on both macOS and iOS.  This makes writing a
test to activate an element via user interaction that works in
DumpRenderTree and WebKitTestRunner across macOS and iOS extremely
challenging.  UIHelper script I added will make this easier by providing an
abstraction around eventSender and UIScriptController by wrapping those
internal APIs.

- R. Niwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20161213/938c03ea/attachment.html>


More information about the webkit-dev mailing list