<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:simon.fraser&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <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&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=289594&amp;action=diff" name="attach_289594" title="Patch">attachment 289594</a> <a href="attachment.cgi?id=289594&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=289594&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=289594&amp;action=review</a>

<span class="quote">&gt; Tools/ChangeLog:8
&gt; +        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">&gt; Tools/ChangeLog:9
&gt; +        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">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.h:49
&gt; +// Special Presses</span >

Let's say &quot;Long press and force press&quot;

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:40
&gt; -static const NSTimeInterval fingerLiftDelay = 5e7;
&gt; -static const NSTimeInterval multiTapInterval = 15e7;
&gt; +static const long fingerLiftDelay = 5e7;
&gt; +static const long multiTapInterval = 15e7;</span >

Revert this part.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-55
&gt; -    HandEventCanceled,</span >

I think we should keep Canceled, because we should test event cancellation at some point.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:-191
&gt; -        } else if (eventType == HandEventLifted || eventType == HandEventCanceled || eventType == StylusEventLifted) {</span >

Keep canceled.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:505
&gt; -    struct timespec doubleDelay = { 0, static_cast&lt;long&gt;(multiTapInterval) };
&gt; -    struct timespec pressDelay = { 0, static_cast&lt;long&gt;(fingerLiftDelay) };
&gt; +    struct timespec doubleDelay = { 0, multiTapInterval };
&gt; +    struct timespec pressDelay = { 0, fingerLiftDelay };</span >

Revert.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:524
&gt; +- (void)clearTap:(CGPoint)location
&gt; +{
&gt; +    [self touchDown:location touchCount:1];
&gt; +    struct timespec pressDelay = { 0, fingerLiftDelay };
&gt; +    nanosleep(&amp;pressDelay, 0);
&gt; +    [self liftUp:location touchCount:1];
&gt; +}</span >

I still don't think this belongs here.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:556
&gt; +
&gt; +    [self touchDown:location touchCount:1];</span >

Weird blank line.

<span class="quote">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:561
&gt; +    [NSTimer scheduledTimerWithTimeInterval:longPressHoldDelay target:self selector:&#64;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">&gt; Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:562
&gt; +    [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>