Bug 229779 - Rewrite long press and drag tests to be more robust.
Summary: Rewrite long press and drag tests to be more robust.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-01 16:40 PDT by Megan Gardner
Modified: 2021-09-07 11:00 PDT (History)
3 users (show)

See Also:


Attachments
Patch (42.20 KB, patch)
2021-09-01 16:44 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch for landing (42.63 KB, patch)
2021-09-07 10:25 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2021-09-01 16:40:35 PDT
Rewrite long press and drag tests to be more robust.
Comment 1 Megan Gardner 2021-09-01 16:44:21 PDT
Created attachment 437084 [details]
Patch
Comment 2 Wenson Hsieh 2021-09-01 16:49:32 PDT
Comment on attachment 437084 [details]
Patch

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

> Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:407
> +            NSNumber *touchX = touch[HIDEventXKey] == [NSNull null] ? 0 : touch[HIDEventXKey];

Nit - `0` should be `nil`

> Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:408
> +            NSNumber *touchY = touch[HIDEventYKey] == [NSNull null] ? 0 : touch[HIDEventYKey];

Ditto.

> LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html:16
> +        

Nit - stray whitespace.

> LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html:73
> +    

Ditto.

> LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html:16
> +        

Ditto.

> LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html:70
> +    

Ditto.

> LayoutTests/resources/ui-helper.js:822
> +    static  midPointOfRect(rect) {

Nit - it looks like there are two spaces between `static` and `midPointOfRect`.

I'd also write this like `return { x: rect.left + (rect.width / 2), y: rect.top + (rect.height / 2) };`
Comment 3 Wenson Hsieh 2021-09-01 16:50:06 PDT
rdar://40917203
Comment 4 Wenson Hsieh 2021-09-01 16:51:00 PDT
> > Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:407
> > +            NSNumber *touchX = touch[HIDEventXKey] == [NSNull null] ? 0 : touch[HIDEventXKey];
> 
> Nit - `0` should be `nil`
> 

(..at least, either `nil` or `@0`).
Comment 5 Megan Gardner 2021-09-07 10:25:07 PDT
Created attachment 437526 [details]
Patch for landing
Comment 6 EWS 2021-09-07 11:00:45 PDT
Committed r282096 (241395@main): <https://commits.webkit.org/241395@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437526 [details].