<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Add long press selection test"
href="https://bugs.webkit.org/show_bug.cgi?id=162367">bug 162367</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #289594 Flags</td>
<td>review?
</td>
<td>review-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add long press selection test"
href="https://bugs.webkit.org/show_bug.cgi?id=162367#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add long press selection test"
href="https://bugs.webkit.org/show_bug.cgi?id=162367">bug 162367</a>
from <span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=289594&action=diff" name="attach_289594" title="Patch">attachment 289594</a> <a href="attachment.cgi?id=289594&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=289594&action=review">https://bugs.webkit.org/attachment.cgi?id=289594&action=review</a>
<span class="quote">> Tools/ChangeLog:8
> + Added support of Long Press tests.</span >
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.
<span class="quote">> Tools/ChangeLog:9
> + Fixed oddly typed constants.</span >
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.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.h:49
> +// Special Presses</span >
Let's say "Long press and force press"
<span class="quote">> 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;</span >
Revert this part.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-55
> - HandEventCanceled,</span >
I think we should keep Canceled, because we should test event cancellation at some point.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-191
> - } else if (eventType == HandEventLifted || eventType == HandEventCanceled || eventType == StylusEventLifted) {</span >
Keep canceled.
<span class="quote">> 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 };</span >
Revert.
<span class="quote">> 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];
> +}</span >
I still don't think this belongs here.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:556
> +
> + [self touchDown:location touchCount:1];</span >
Weird blank line.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:561
> + [NSTimer scheduledTimerWithTimeInterval:longPressHoldDelay target:self selector:@selector(longPressTimerFired:) userInfo:info repeats:NO];</span >
If you used the block form. you wouldn't have to build an info dictionary or have a separate function for the callback.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:562
> + [completionBlockCopy release];</span >
Use Block_release()</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>