Bug 229779

Summary: Rewrite long press and drag tests to be more robust.
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Status: RESOLVED FIXED    
Severity: Normal CC: thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

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].