Title: [227191] trunk/LayoutTests
Revision
227191
Author
[email protected]
Date
2018-01-18 23:03:50 -0800 (Thu, 18 Jan 2018)

Log Message

Move helper files for iOS touch gestures into LayoutTests/resources
https://bugs.webkit.org/show_bug.cgi?id=181798

Patch by Frederic Wang <[email protected]> on 2018-01-18
Reviewed by Wenson Hsieh.

* fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html: Change URL of
basic-gestures.js ; remove gesture-helpers.js it seems unused and has the wrong URL anyway.
* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html: Change URL
of basic-gestures.js.
* fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-to-select-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html: Ditto.
* fast/events/touch/ios/long-press-to-select-text.html: Ditto.
* resources/basic-gestures.js: Renamed from LayoutTests/fast/events/touch/ios/resources/basic-gestures.js.
* resources/ui-debugging.js: Renamed from LayoutTests/fast/events/touch/ios/resources/ui-debugging.js.
Note that this file was introduced in r222517 but seems unused for now.

Modified Paths

Added Paths

Removed Paths

  • trunk/LayoutTests/fast/events/touch/ios/resources/

Diff

Modified: trunk/LayoutTests/ChangeLog (227190 => 227191)


--- trunk/LayoutTests/ChangeLog	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/ChangeLog	2018-01-19 07:03:50 UTC (rev 227191)
@@ -1,3 +1,24 @@
+2018-01-18  Frederic Wang  <[email protected]>
+
+        Move helper files for iOS touch gestures into LayoutTests/resources
+        https://bugs.webkit.org/show_bug.cgi?id=181798
+
+        Reviewed by Wenson Hsieh.
+
+        * fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html: Change URL of
+        basic-gestures.js ; remove gesture-helpers.js it seems unused and has the wrong URL anyway.
+        * fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html: Change URL
+        of basic-gestures.js.
+        * fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html: Ditto.
+        * fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html: Ditto.
+        * fast/events/touch/ios/long-press-then-drag-to-select-text.html: Ditto.
+        * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html: Ditto.
+        * fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html: Ditto.
+        * fast/events/touch/ios/long-press-to-select-text.html: Ditto.
+        * resources/basic-gestures.js: Renamed from LayoutTests/fast/events/touch/ios/resources/basic-gestures.js.
+        * resources/ui-debugging.js: Renamed from LayoutTests/fast/events/touch/ios/resources/ui-debugging.js.
+        Note that this file was introduced in r222517 but seems unused for now.
+
 2018-01-18  Ryan Haddad  <[email protected]>
 
         Mark platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html as flaky.

Modified: trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,8 +2,7 @@
 
 <html>
 <head>
-    <script src=""
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-to-select-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-text.html (227190 => 227191)


--- trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-text.html	2018-01-19 06:33:11 UTC (rev 227190)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-to-select-text.html	2018-01-19 07:03:50 UTC (rev 227191)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-    <script src=""
+    <script src=""
     <script>
         if (window.testRunner) {
             testRunner.dumpAsText();

Copied: trunk/LayoutTests/resources/basic-gestures.js (from rev 227190, trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js) (0 => 227191)


--- trunk/LayoutTests/resources/basic-gestures.js	                        (rev 0)
+++ trunk/LayoutTests/resources/basic-gestures.js	2018-01-19 07:03:50 UTC (rev 227191)
@@ -0,0 +1,220 @@
+function didShowKeyboard()
+{
+	return `
+	(function() {
+        uiController.didShowKeyboardCallback = function() {
+            uiController.uiScriptComplete();
+		}
+    })();`
+}
+
+
+function longPressAtPoint(x, y)
+{
+    return `
+    (function() {
+        uiController.longPressAtPoint(${x}, ${y}, function() {
+            uiController.uiScriptComplete();
+        });
+    })();`
+}
+
+function liftUpAtPoint(x, y)
+{
+    return `
+    (function() {
+        uiController.liftUpAtPoint(${x}, ${y}, 1, function() {
+            uiController.uiScriptComplete();
+        });
+    })();`
+}
+
+function longPressAndHoldAtPoint(x, y)
+{
+    return `
+    (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
+                    }
+                ]
+            },
+            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();
+    })();`
+}
+
+function tapAtPoint(x, y)
+{
+    return `
+    (function() {
+        uiController.singleTapAtPoint(${x}, ${y}, function() {
+            uiController.uiScriptComplete();
+        });
+    })();`
+}
+
+function touchAndDragFromPointToPoint(startX, startY, endX, endY)
+{
+    return `
+    (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
+                    }
+                ]
+            },
+            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();
+    })();`
+}
+
+function holdAtPoint(x, y)
+{
+    return `
+    (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
+                    }
+                ]
+            },
+            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();
+    })();`
+}
+
+function continueTouchAndDragFromPointToPoint(startX, startY, endX, endY)
+{
+    return `
+    (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
+                       }
+                   ]
+               }
+     }]};
+     
+     uiController.sendEventStream(JSON.stringify(eventStream), function() {});
+         uiController.uiScriptComplete();
+     })();`
+}

Property changes: trunk/LayoutTests/resources/basic-gestures.js


Added: svn:eol-style

+LF \ No newline at end of property

Added: svn:mime-type

+text/_javascript_ \ No newline at end of property

Copied: trunk/LayoutTests/resources/ui-debugging.js (from rev 227190, trunk/LayoutTests/fast/events/touch/ios/resources/ui-debugging.js) (0 => 227191)


--- trunk/LayoutTests/resources/ui-debugging.js	                        (rev 0)
+++ trunk/LayoutTests/resources/ui-debugging.js	2018-01-19 07:03:50 UTC (rev 227191)
@@ -0,0 +1,58 @@
+// To double check location of touches or other x,y coordinates
+function debugDot(x, y, element = document.body)
+{
+    var dotSize = 10;
+    var dot = document.getElementById("debugDot");
+    if (!dot) {
+        dot = document.createElement("div");
+        dot.id = "debugDot";
+    }
+    
+    dot.style.pointerEvents = "none";
+    
+    dot.style.position = "absolute";
+    dot.style.height = dotSize + "px";
+    dot.style.width = dotSize + "px";
+    dot.style.backgroundColor = "DeepPink";
+    dot.style.borderRadius = "100%";
+    dot.style.left = (x - dotSize/2)+"px";
+    dot.style.top = (y - dotSize/2)+"px";
+    
+    element.appendChild(dot);
+}
+
+function removeDebugDot()
+{
+    var dot = document.getElementById("debugDot");
+    if (dot.parentNode)
+        dot.parentNode.removeChild(dot);
+}
+
+// To double check location of word boxes or other x,y coordinates
+function debugRect(x, y, width, height, element = document.body)
+{
+    var rect = document.getElementById("debugRect");
+    if (!rect) {
+        rect = document.createElement("div");
+        rect.id = "debugRect";
+    }
+    
+    rect.style.pointerEvents = "none";
+    
+    rect.style.position = "absolute";
+    rect.style.height = height + "px";
+    rect.style.width = width + "px";
+    rect.style.backgroundColor = "rgba(255,0,255,0.5)";
+    rect.style.top = y + "px";
+    rect.style.left = x + "px";
+    
+    element.appendChild(rect);
+}
+
+function removeDebugRect()
+{
+    var rect = document.getElementById("debugRect");
+    if (rect.parentNode)
+        rect.parentNode.removeChild(rect);
+}
+

Property changes: trunk/LayoutTests/resources/ui-debugging.js


Added: svn:eol-style

+LF \ No newline at end of property

Added: svn:mime-type

+text/_javascript_ \ No newline at end of property
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to