[Webkit-unassigned] [Bug 162367] Add long press selection test
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 22 14:15:24 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=162367
Simon Fraser (smfr) <simon.fraser at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #289594|review? |review-
Flags| |
--- Comment #5 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 289594
--> https://bugs.webkit.org/attachment.cgi?id=289594
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=289594&action=review
> Tools/ChangeLog:8
> + Added support of Long Press tests.
I think this needs a little more explanation. I suggestion something like:
Add support to UIScriptController to synthesize long press events on iOS. This required adding long-press functionality to HIDEventGenerator.
HIDEventGenerator sends the touchDown, but must then send the touchUp on a timer (rather than sleeping, as we do for other events) in order for the gesture recognizers to correctly detect a long press.
Use the long press synthesis in a test that detects whether a long press gesture triggers text selection.
> Tools/ChangeLog:9
> + Fixed oddly typed constants.
They aren't oddly typed; NSTimeInterval is the correct way to store durations. What's odd is that they get shoved into a timespec. I'd leave this as-is.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.h:49
> +// Special Presses
Let's say "Long press and force press"
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:40
> -static const NSTimeInterval fingerLiftDelay = 5e7;
> -static const NSTimeInterval multiTapInterval = 15e7;
> +static const long fingerLiftDelay = 5e7;
> +static const long multiTapInterval = 15e7;
Revert this part.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-55
> - HandEventCanceled,
I think we should keep Canceled, because we should test event cancellation at some point.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-191
> - } else if (eventType == HandEventLifted || eventType == HandEventCanceled || eventType == StylusEventLifted) {
Keep canceled.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:505
> - struct timespec doubleDelay = { 0, static_cast<long>(multiTapInterval) };
> - struct timespec pressDelay = { 0, static_cast<long>(fingerLiftDelay) };
> + struct timespec doubleDelay = { 0, multiTapInterval };
> + struct timespec pressDelay = { 0, fingerLiftDelay };
Revert.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:524
> +- (void)clearTap:(CGPoint)location
> +{
> + [self touchDown:location touchCount:1];
> + struct timespec pressDelay = { 0, fingerLiftDelay };
> + nanosleep(&pressDelay, 0);
> + [self liftUp:location touchCount:1];
> +}
I still don't think this belongs here.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:556
> +
> + [self touchDown:location touchCount:1];
Weird blank line.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:561
> + [NSTimer scheduledTimerWithTimeInterval:longPressHoldDelay target:self selector:@selector(longPressTimerFired:) userInfo:info repeats:NO];
If you used the block form. you wouldn't have to build an info dictionary or have a separate function for the callback.
> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:562
> + [completionBlockCopy release];
Use Block_release()
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160922/f1220000/attachment.html>
More information about the webkit-unassigned
mailing list