Bug 216933

Summary: Pause is needed while simulating mouse actions
Product: WebKit Reporter: cathiechen <cathiechen>
Component: Tools / TestsAssignee: cathiechen <cathiechen>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, clopez, darin, ews-watchlist, fred.wang, gsnedders, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description cathiechen 2020-09-24 10:01:05 PDT
Test code like below would not work if pause is not supported.

         test_driver.Actions()
            .addPointer("pointer1", "mouse")
            .pointerMove(0, 0, { origin: target })
            .pointerDown()
            .pointerMove(originpos.x, originpos.y, { origin: target })
            .pointerMove(originpos.x + delta.x / 2, originpos.y + delta.y / 2, { origin: target })
            .pointerMove(originpos.x + delta.x, originpos.y + delta.y, { origin: target })
            .pause(duriation)
            .pointerUp()
            .send();
Comment 1 cathiechen 2020-09-24 10:04:11 PDT
Created attachment 409589 [details]
Patch
Comment 2 EWS Watchlist 2020-09-24 10:04:43 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 BJ Burg 2020-09-24 14:16:37 PDT
Comment on attachment 409589 [details]
Patch

This seems to have regressed a few tests according to EWS. Please investigate.
Comment 4 cathiechen 2020-09-25 11:40:02 PDT
Created attachment 409713 [details]
Patch
Comment 5 cathiechen 2020-09-25 16:03:44 PDT
(In reply to Brian Burg from comment #3)
> Comment on attachment 409589 [details]
> Patch
> 
> This seems to have regressed a few tests according to EWS. Please
> investigate.

Done! Thanks
Comment 6 Darin Adler 2020-09-26 16:03:09 PDT
Comment on attachment 409713 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409713&action=review

> LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:10
> +// Provide an imprecise way of pause.

This comment is not grammatically correct and it’s also unclear. I suppose it’s saying that there is something wrong with the implementation, but what? I suggest omitting the comment, or we could include it if we can pinpoint *what* we are trying to say and find a good way to word it.

Is there something wrong with using setTimeout to pause? If so, what is it? Is there a problem with precision of the duration? Or is the problem that a timeout is queued behind other operations or on the wrong run loop? Maybe there is nothing wrong!

> LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:50
> +                    // FIXME: Provide a precise way of pause.

Same thing here. Please just remove this comment or if you like I can try to help write one for whatever we mean here.
Comment 7 cathiechen 2020-09-27 03:53:05 PDT
Comment on attachment 409713 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=409713&action=review

>> LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:10
>> +// Provide an imprecise way of pause.
> 
> This comment is not grammatically correct and it’s also unclear. I suppose it’s saying that there is something wrong with the implementation, but what? I suggest omitting the comment, or we could include it if we can pinpoint *what* we are trying to say and find a good way to word it.
> 
> Is there something wrong with using setTimeout to pause? If so, what is it? Is there a problem with precision of the duration? Or is the problem that a timeout is queued behind other operations or on the wrong run loop? Maybe there is nothing wrong!

Thanks! I'll remove them.
Yeah, looks like nothing is wrong. I added the comments because setTimeout seems not as precise as the pause in dispatchTouchActions.
Comment 8 cathiechen 2020-09-27 03:56:23 PDT
Created attachment 409824 [details]
Patch
Comment 9 cathiechen 2020-09-27 04:10:23 PDT
Created attachment 409825 [details]
Patch
Comment 10 EWS 2020-09-27 05:56:02 PDT
Committed r267656: <https://trac.webkit.org/changeset/267656>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409825 [details].
Comment 11 Radar WebKit Bug Importer 2020-09-27 05:57:17 PDT
<rdar://problem/69654722>