Title: [196989] trunk/LayoutTests
Revision
196989
Author
[email protected]
Date
2016-02-23 12:38:37 -0800 (Tue, 23 Feb 2016)

Log Message

Add tests for fast click change in r196679
https://bugs.webkit.org/show_bug.cgi?id=154568
<rdar://problem/24782479>

Reviewed by Myles Maxfield.

Bug http://webkit.org/b/154318 made some changes to the fast
click behaviour, but didn't include any tests. Here they are!

* fast/events/ios/fast-click-double-tap-sends-click-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-sends-click.html: Checks that a double tap on a clickable element sends a click.
* fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-zooms-on-image.html: Checks that a double tap on an image can trigger a zoom if there
isn't anything else listening.
* fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-zooms-on-text.html: Checks that a double tap on a block of text can trigger a zoom
if there isn't anything else listening.
* fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt: Added.
* fast/events/ios/no-fast-click-double-tap-causes-zoom.html: When we are not in fast click mode, a double tap should
trigger a zoom. This is checking the inverse behaviour to fast-click-double-tap-sends-click.
* fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html: Removed some code that could never be called.
* fast/events/ios/viewport-zooms-from-element-to-initial-scale.html: Ditto.
* platform/ios-simulator/TestExpectations: Add the new tests.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196988 => 196989)


--- trunk/LayoutTests/ChangeLog	2016-02-23 20:09:07 UTC (rev 196988)
+++ trunk/LayoutTests/ChangeLog	2016-02-23 20:38:37 UTC (rev 196989)
@@ -1,3 +1,29 @@
+2016-02-22  Dean Jackson  <[email protected]>
+
+        Add tests for fast click change in r196679
+        https://bugs.webkit.org/show_bug.cgi?id=154568
+        <rdar://problem/24782479>
+
+        Reviewed by Myles Maxfield.
+
+        Bug http://webkit.org/b/154318 made some changes to the fast
+        click behaviour, but didn't include any tests. Here they are!
+
+        * fast/events/ios/fast-click-double-tap-sends-click-expected.txt: Added.
+        * fast/events/ios/fast-click-double-tap-sends-click.html: Checks that a double tap on a clickable element sends a click.
+        * fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt: Added.
+        * fast/events/ios/fast-click-double-tap-zooms-on-image.html: Checks that a double tap on an image can trigger a zoom if there
+        isn't anything else listening.
+        * fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt: Added.
+        * fast/events/ios/fast-click-double-tap-zooms-on-text.html: Checks that a double tap on a block of text can trigger a zoom
+        if there isn't anything else listening.
+        * fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt: Added.
+        * fast/events/ios/no-fast-click-double-tap-causes-zoom.html: When we are not in fast click mode, a double tap should
+        trigger a zoom. This is checking the inverse behaviour to fast-click-double-tap-sends-click.
+        * fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html: Removed some code that could never be called.
+        * fast/events/ios/viewport-zooms-from-element-to-initial-scale.html: Ditto.
+        * platform/ios-simulator/TestExpectations: Add the new tests.
+
 2016-02-23  Alexey Proskuryakov  <[email protected]>
 
         REGRESSION (r192251): http/tests/navigation/page-cache-xhr.html is flaky

Added: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click-expected.txt (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click-expected.txt	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,2 @@
+PASS: Click fired on element with handler.
+This document is set up to enable fast clicks. Double tapping on the rectangle above should send a click event, not trigger a zoom.
Property changes on: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Copied: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click.html (from rev 196988, trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html) (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-sends-click.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,61 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=1.0, width=device-width">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.singleTapAtPoint(50, 50, function() {});
+            uiController.singleTapAtPoint(50, 50, function() {
+                uiController.uiScriptComplete();
+            });
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        var target;
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            target = document.getElementById("target");
+            target.addEventListener("click", handleClick, false);
+
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            testRunner.runUIScript(getUIScript(), function() {});
+        }
+
+        function handleClick(event)
+        {
+            target.textContent = "PASS: Click fired on element with handler.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+<div id="description">This document is set up to enable fast clicks. Double
+tapping on the rectangle above should send a click event, not trigger a
+zoom.</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,3 @@
+
+PASS: Double tap caused zoom.
+This document is set up to enable fast clicks. However, since the green image doesn't have any handlers, double tapping on it should trigger a zoom, not a fast click.
Property changes on: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image.html (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,67 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="width=600">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete();
+            };
+            uiController.singleTapAtPoint(80, 80, function() {});
+            uiController.singleTapAtPoint(80, 80, function() {});
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        var target, output;
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            output = document.getElementById("output");
+            target = document.getElementById("target");
+            target.addEventListener("click", handleClick, false);
+
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            testRunner.runUIScript(getUIScript(), function() {
+                output.textContent = "PASS: Double tap caused zoom.";
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick(event)
+        {
+            output.textContent = "PASS: Click fired on element with handler.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+            width: 300px;
+        }
+        #target {
+            height: 200px;
+            width: 200px;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<img id="target" src="" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'><rect width='1' height='1' fill='green'/><circle cx='0.5' cy='0.5' r='0.5' fill='blue'/></svg>"><br>
+<div id="output"></div>
+<div id="description">This document is set up to enable fast clicks. However, since
+the green image doesn't have any handlers, double tapping on it
+should trigger a zoom, not a fast click.</div>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-image.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,3 @@
+PASS: Double tap caused zoom.
+This document is set up to enable fast clicks. Double tapping on the rectangle would send a click event, not trigger a zoom. But double tapping on this text content should zoom.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut l
 abore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco labori
 s nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Property changes on: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text.html (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,99 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="width=600">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete();
+            };
+            uiController.singleTapAtPoint(50, 120, function() {});
+            uiController.singleTapAtPoint(50, 120, function() {});
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        var target;
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            target = document.getElementById("target");
+            target.addEventListener("click", handleClick, false);
+            var description = document.getElementById("description");
+            description.addEventListener("click", handleClick, false);
+
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            testRunner.runUIScript(getUIScript(), function() {
+                target.textContent = "PASS: Double tap caused zoom.";
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick(event)
+        {
+            target.textContent = "PASS: Click fired on element with handler.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+            width: 300px;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+<div id="description">This document is set up to enable fast clicks. Double
+tapping on the rectangle would send a click event, not trigger a
+zoom. But double tapping on this text content should zoom.<br>
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+</div>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/events/ios/fast-click-double-tap-zooms-on-text.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,2 @@
+PASS: Double tap caused zoom.
+This document is set up to disable fast clicks. Double tapping on the rectangle above should zoom, not send a click event.
Property changes on: trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Copied: trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom.html (from rev 196988, trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html) (0 => 196989)


--- trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/no-fast-click-double-tap-causes-zoom.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -0,0 +1,64 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=1.0">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete();
+            };
+            uiController.singleTapAtPoint(50, 50, function() {});
+            uiController.singleTapAtPoint(50, 50, function() {});
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        var target;
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            target = document.getElementById("target");
+            target.addEventListener("click", handleClick, false);
+
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            testRunner.runUIScript(getUIScript(), function() {
+                target.textContent = "PASS: Double tap caused zoom.";
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick(event)
+        {
+            target.textContent = "FAIL: Click fired on element with handler.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+<div id="description">This document is set up to disable fast clicks. Double
+tapping on the rectangle above should zoom, not send a click event.</div>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html (196988 => 196989)


--- trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html	2016-02-23 20:09:07 UTC (rev 196988)
+++ trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -33,12 +33,6 @@
                 testRunner.notifyDone();
             });
         }
-
-        function handleClick()
-        {
-            document.getElementById("target").innerText = "FAIL: Click fired when we should only be zooming.";
-            testRunner.notifyDone();
-        }
     </script>
     <style>
         body {

Modified: trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html (196988 => 196989)


--- trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html	2016-02-23 20:09:07 UTC (rev 196988)
+++ trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html	2016-02-23 20:38:37 UTC (rev 196989)
@@ -33,12 +33,6 @@
                 testRunner.notifyDone();
             });
         }
-
-        function handleClick()
-        {
-            document.getElementById("target").innerText = "FAIL: Click fired when we should only be zooming.";
-            testRunner.notifyDone();
-        }
     </script>
     <style>
         body {

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (196988 => 196989)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-02-23 20:09:07 UTC (rev 196988)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-02-23 20:38:37 UTC (rev 196989)
@@ -2839,6 +2839,10 @@
 webkit.org/b/152134 fast/events/ios/unscalable-viewport-clicks-on-doubletap.html [ Pass Timeout ]
 webkit.org/b/152134 fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html  [ Pass Timeout ]
 webkit.org/b/152134 fast/events/ios/viewport-no-width-value-allows-double-tap.html  [ Pass Timeout ]
+webkit.org/b/152134 fast/events/ios/fast-click-double-tap-sends-click.html  [ Pass Timeout ]
+webkit.org/b/152134 fast/events/ios/fast-click-double-tap-zooms-on-text.html  [ Pass Timeout ]
+webkit.org/b/152134 fast/events/ios/fast-click-double-tap-zooms-on-image.html  [ Pass Timeout ]
+webkit.org/b/152134 fast/events/ios/no-fast-click-double-tap-causes-zoom.html  [ Pass Timeout ]
 
 # Failing tests related to picture element
 webkit.org/b/152141 fast/picture/image-picture-1x.html [ Skip ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to