Changeset 222337 in webkit


Ignore:
Timestamp:
Sep 21, 2017 11:48:08 AM (7 years ago)
Author:
Megan Gardner
Message:

Add long press and drag test
https://bugs.webkit.org/show_bug.cgi?id=177289

Reviewed by Simon Fraser and Tim Horton.

Adding a test to test the long press and then drag functionality of selection.
Also add additional helper functions to basic gestures, and clarified the existing function
names, as to be more clear in what behavior to expect from them.

  • fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt: Added.
  • fast/events/touch/ios/long-press-then-drag-to-select-text.html: Added.
  • fast/events/touch/ios/resources/basic-gestures.js:

(touchAndDragFromPointToPoint):

Location:
trunk/LayoutTests
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222332 r222337  
     12017-09-21  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Add long press and drag test
     4        https://bugs.webkit.org/show_bug.cgi?id=177289
     5
     6        Reviewed by Simon Fraser and Tim Horton.
     7
     8        Adding a test to test the long press and then drag functionality of selection.
     9        Also add additional helper functions to basic gestures, and clarified the existing function
     10        names, as to be more clear in what behavior to expect from them.
     11
     12        * fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt: Added.
     13        * fast/events/touch/ios/long-press-then-drag-to-select-text.html: Added.
     14        * fast/events/touch/ios/resources/basic-gestures.js:
     15        (touchAndDragFromPointToPoint):
     16
    1172017-09-21  Ryan Haddad  <ryanhaddad@apple.com>
    218
  • trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js

    r210941 r222337  
    88    })();`
    99}
     10
     11// We should switch to this method in all tests, as it is more clear what is being done.
     12// The original helper function should not be used
     13function touchAndDragFromPointToPoint(startX, startY, endX, endY)
     14{
     15    return dragFromPointToPoint(startX, startY, endX, endY);
     16}
     17
    1018
    1119function dragFromPointToPoint(startX, startY, endX, endY)
     
    5361    })();`
    5462}
     63
     64function pressAndHoldAtPoint(X, Y)
     65{
     66    return `
     67    (function() {
     68     var eventStream = {
     69     events : [
     70         {
     71             interpolate : "linear",
     72             timestep: 0.1,
     73             coordinateSpace : "content",
     74             startEvent : {
     75             inputType : "hand",
     76             timeOffset : 0,
     77             touches : [
     78                        {
     79                        inputType : "finger",
     80                        phase : "began",
     81                        id : 1,
     82                        x : ${X},
     83                        y : ${Y},
     84                        pressure : 0
     85                        }
     86                        ]
     87             },
     88             endEvent : {
     89             inputType : "hand",
     90             timeOffset : 2.0,
     91             touches : [
     92                        {
     93                        inputType : "finger",
     94                        phase : "moved",
     95                        id : 1,
     96                        x : ${X},
     97                        y : ${Y},
     98                        pressure : 0
     99                        }
     100                        ]
     101             }
     102         }]};
     103     
     104         uiController.sendEventStream(JSON.stringify(eventStream), function() {});
     105         uiController.uiScriptComplete();
     106     })();`
     107}
     108
     109
     110function continueTouchAndDragFromPointToPoint(startX, startY, endX, endY)
     111{
     112    return `
     113    (function() {
     114     var eventStream = {
     115     events : [
     116         {
     117             interpolate : "linear",
     118             timestep: 0.1,
     119             coordinateSpace : "content",
     120             startEvent : {
     121             inputType : "hand",
     122             timeOffset : 0,
     123             touches : [
     124                        {
     125                        inputType : "finger",
     126                        phase : "moved",
     127                        id : 1,
     128                        x : ${startX},
     129                        y : ${startY},
     130                        pressure : 0
     131                        }
     132                        ]
     133             },
     134             endEvent : {
     135             inputType : "hand",
     136             timeOffset : 0.5,
     137             touches : [
     138                        {
     139                        inputType : "finger",
     140                        phase : "moved",
     141                        id : 1,
     142                        x : ${endX},
     143                        y : ${endY},
     144                        pressure : 0
     145                        }
     146                        ]
     147             }
     148         }]};
     149     
     150         uiController.sendEventStream(JSON.stringify(eventStream), function() {});
     151         uiController.uiScriptComplete();
     152     })();`
     153}
Note: See TracChangeset for help on using the changeset viewer.