Title: [248752] trunk/LayoutTests
Revision
248752
Author
wenson_hs...@apple.com
Date
2019-08-15 17:37:20 -0700 (Thu, 15 Aug 2019)

Log Message

Tidy up some event stream helpers in basic-gestures.js
https://bugs.webkit.org/show_bug.cgi?id=200783

Reviewed by Tim Horton.

* resources/basic-gestures.js:

Make a few small adjustments:
(1) Invoke uiScriptComplete within the completion callback of sendEventStream. This actually doesn't result in
    any behavior differences, since UIScriptController will, by default, wait for non-persistent asynchronous
    tasks to finish before allowing the UI-side script invocation to finish.
(2) Fix some minor indentation issues in longPressAndHoldAtPoint, touchAndDragFromPointToPoint, holdAtPoint,
    and continueTouchAndDragFromPointToPoint.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248751 => 248752)


--- trunk/LayoutTests/ChangeLog	2019-08-16 00:12:42 UTC (rev 248751)
+++ trunk/LayoutTests/ChangeLog	2019-08-16 00:37:20 UTC (rev 248752)
@@ -1,3 +1,19 @@
+2019-08-15  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Tidy up some event stream helpers in basic-gestures.js
+        https://bugs.webkit.org/show_bug.cgi?id=200783
+
+        Reviewed by Tim Horton.
+
+        * resources/basic-gestures.js:
+
+        Make a few small adjustments:
+        (1) Invoke uiScriptComplete within the completion callback of sendEventStream. This actually doesn't result in
+            any behavior differences, since UIScriptController will, by default, wait for non-persistent asynchronous
+            tasks to finish before allowing the UI-side script invocation to finish.
+        (2) Fix some minor indentation issues in longPressAndHoldAtPoint, touchAndDragFromPointToPoint, holdAtPoint,
+            and continueTouchAndDragFromPointToPoint.
+
 2019-08-15  Zalan Bujtas  <za...@apple.com>
 
         [ContentChangeObserver] Dispatch synthetic click when the visibility candidate element becomes hidden again.

Modified: trunk/LayoutTests/resources/basic-gestures.js (248751 => 248752)


--- trunk/LayoutTests/resources/basic-gestures.js	2019-08-16 00:12:42 UTC (rev 248751)
+++ trunk/LayoutTests/resources/basic-gestures.js	2019-08-16 00:37:20 UTC (rev 248752)
@@ -68,44 +68,45 @@
     return new Promise(resolve => {
         testRunner.runUIScript(`
             (function() {
-            var eventStream = {
-            events : [
-                {
-                    interpolate : "linear",
-                    timestep: 0.1,
-                    coordinateSpace : "content",
-                    startEvent : {
-                        inputType : "hand",
-                        timeOffset : 0,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "began",
-                                id : 1,
-                                x : ${x},
-                                y : ${y},
-                                pressure : 0
+                const eventStream = {
+                    events : [
+                        {
+                            interpolate : "linear",
+                            timestep: 0.1,
+                            coordinateSpace : "content",
+                            startEvent : {
+                                inputType : "hand",
+                                timeOffset : 0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "began",
+                                        id : 1,
+                                        x : ${x},
+                                        y : ${y},
+                                        pressure : 0
+                                    }
+                                ]
+                            },
+                            endEvent : {
+                                inputType : "hand",
+                                timeOffset : 2.0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${x},
+                                        y : ${y},
+                                        pressure : 0
+                                    }
+                                ]
                             }
-                        ]
-                    },
-                    endEvent : {
-                        inputType : "hand",
-                        timeOffset : 2.0,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "moved",
-                                id : 1,
-                                x : ${x},
-                                y : ${y},
-                                pressure : 0
-                            }
-                        ]
-                    }
-            }]};
+                        }
+                    ]
+                };
 
-            uiController.sendEventStream(JSON.stringify(eventStream), function() {});
-                uiController.uiScriptComplete();
+                uiController.sendEventStream(JSON.stringify(eventStream), () => uiController.uiScriptComplete());
             })();`, resolve);
     });
 }
@@ -127,44 +128,45 @@
     return new Promise(resolve => {
         testRunner.runUIScript(`
             (function() {
-            var eventStream = {
-            events : [
-                {
-                    interpolate : "linear",
-                    timestep: 0.1,
-                    coordinateSpace : "content",
-                    startEvent : {
-                        inputType : "hand",
-                        timeOffset : 0,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "began",
-                                id : 1,
-                                x : ${startX},
-                                y : ${startY},
-                                pressure : 0
+                const eventStream = {
+                    events : [
+                        {
+                            interpolate : "linear",
+                            timestep: 0.1,
+                            coordinateSpace : "content",
+                            startEvent : {
+                                inputType : "hand",
+                                timeOffset : 0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "began",
+                                        id : 1,
+                                        x : ${startX},
+                                        y : ${startY},
+                                        pressure : 0
+                                    }
+                                ]
+                            },
+                            endEvent : {
+                                inputType : "hand",
+                                timeOffset : 0.5,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${endX},
+                                        y : ${endY},
+                                        pressure : 0
+                                    }
+                                ]
                             }
-                        ]
-                    },
-                    endEvent : {
-                        inputType : "hand",
-                        timeOffset : 0.5,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "moved",
-                                id : 1,
-                                x : ${endX},
-                                y : ${endY},
-                                pressure : 0
-                            }
-                        ]
-                    }
-            }]};
+                        }
+                    ]
+                };
 
-            uiController.sendEventStream(JSON.stringify(eventStream), function() {});
-                uiController.uiScriptComplete();
+                uiController.sendEventStream(JSON.stringify(eventStream), () => uiController.uiScriptComplete());
             })();`, resolve);
     });
 }
@@ -174,44 +176,45 @@
     return new Promise(resolve => {
         testRunner.runUIScript(`
             (function() {
-            var eventStream = {
-            events : [
-                {
-                    interpolate : "linear",
-                    timestep: 0.1,
-                    coordinateSpace : "content",
-                    startEvent : {
-                        inputType : "hand",
-                        timeOffset : 0,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "moved",
-                                id : 1,
-                                x : ${x},
-                                y : ${y},
-                                pressure : 0
+                const eventStream = {
+                    events : [
+                        {
+                            interpolate : "linear",
+                            timestep: 0.1,
+                            coordinateSpace : "content",
+                            startEvent : {
+                                inputType : "hand",
+                                timeOffset : 0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${x},
+                                        y : ${y},
+                                        pressure : 0
+                                    }
+                                ]
+                            },
+                            endEvent : {
+                                inputType : "hand",
+                                timeOffset : 5.0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${x},
+                                        y : ${y},
+                                        pressure : 0
+                                    }
+                                ]
                             }
-                        ]
-                    },
-                    endEvent : {
-                        inputType : "hand",
-                        timeOffset : 5.0,
-                        touches : [
-                            {
-                                inputType : "finger",
-                                phase : "moved",
-                                id : 1,
-                                x : ${x},
-                                y : ${y},
-                                pressure : 0
-                            }
-                        ]
-                    }
-            }]};
+                        }
+                    ]
+                };
 
-            uiController.sendEventStream(JSON.stringify(eventStream), function() {});
-                uiController.uiScriptComplete();
+                uiController.sendEventStream(JSON.stringify(eventStream), () => uiController.uiScriptComplete());
             })();`, resolve);
     });
 }
@@ -221,44 +224,45 @@
     return new Promise(resolve => {
         testRunner.runUIScript(`
             (function() {
-             var eventStream = {
-             events : [
-                       {
-                       interpolate : "linear",
-                       timestep: 0.1,
-                       coordinateSpace : "content",
-                       startEvent : {
-                           inputType : "hand",
-                           timeOffset : 0,
-                           touches : [
-                               {
-                                   inputType : "finger",
-                                   phase : "moved",
-                                   id : 1,
-                                   x : ${startX},
-                                   y : ${startY},
-                                   pressure : 0
-                               }
-                           ]
-                       },
-                       endEvent : {
-                           inputType : "hand",
-                           timeOffset : 0.5,
-                           touches : [
-                               {
-                                   inputType : "finger",
-                                   phase : "moved",
-                                   id : 1,
-                                   x : ${endX},
-                                   y : ${endY},
-                                   pressure : 0
-                               }
-                           ]
-                       }
-             }]};
+                const eventStream = {
+                    events : [
+                        {
+                            interpolate : "linear",
+                            timestep: 0.1,
+                            coordinateSpace : "content",
+                            startEvent : {
+                                inputType : "hand",
+                                timeOffset : 0,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${startX},
+                                        y : ${startY},
+                                        pressure : 0
+                                    }
+                                ]
+                            },
+                            endEvent : {
+                                inputType : "hand",
+                                timeOffset : 0.5,
+                                touches : [
+                                    {
+                                        inputType : "finger",
+                                        phase : "moved",
+                                        id : 1,
+                                        x : ${endX},
+                                        y : ${endY},
+                                        pressure : 0
+                                    }
+                                ]
+                            }
+                        }
+                    ]
+                };
 
-             uiController.sendEventStream(JSON.stringify(eventStream), function() {});
-                 uiController.uiScriptComplete();
-             })();`, resolve);
+                uiController.sendEventStream(JSON.stringify(eventStream), () => uiController.uiScriptComplete());
+            })();`, resolve);
     });
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to