Awesome,

In UIHelper, we heavily use Promises.
I think we can further simplify the test code with async/await.

For example,

UIHelper.wait(async function () {
    await UIHelper.activateAt(shadowHost.offsetLeft + 5,
shadowHost.offsetTop + 5);
    await UIHelper.activateAt(shadowHost.offsetLeft + 25,
shadowHost.offsetTop + 25);
});

Regards,
Yusuke Suzuki

On Wed, Dec 14, 2016 at 3:55 PM, Ryosuke Niwa <[email protected]> wrote:

> 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
>
>
> _______________________________________________
> webkit-dev mailing list
> [email protected]
> https://lists.webkit.org/mailman/listinfo/webkit-dev
>
>
_______________________________________________
webkit-dev mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to