Title: [208447] trunk/LayoutTests
Revision
208447
Author
cdu...@apple.com
Date
2016-11-09 10:35:51 -0800 (Wed, 09 Nov 2016)

Log Message

Add test coverage for radiusX / radiusY in WebPlatformTouchPoint.
https://bugs.webkit.org/show_bug.cgi?id=162801
<rdar://problem/28807455>

Reviewed by Darin Adler.

Add test coverage for radiusX / radiusY in WebPlatformTouchPoint.

* fast/events/touch/ios/touch-event-radius-expected.txt: Added.
* fast/events/touch/ios/touch-event-radius.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208446 => 208447)


--- trunk/LayoutTests/ChangeLog	2016-11-09 18:32:02 UTC (rev 208446)
+++ trunk/LayoutTests/ChangeLog	2016-11-09 18:35:51 UTC (rev 208447)
@@ -1,3 +1,16 @@
+2016-11-09  Chris Dumez  <cdu...@apple.com>
+
+        Add test coverage for radiusX / radiusY in WebPlatformTouchPoint.
+        https://bugs.webkit.org/show_bug.cgi?id=162801
+        <rdar://problem/28807455>
+
+        Reviewed by Darin Adler.
+
+        Add test coverage for radiusX / radiusY in WebPlatformTouchPoint.
+
+        * fast/events/touch/ios/touch-event-radius-expected.txt: Added.
+        * fast/events/touch/ios/touch-event-radius.html: Added.
+
 2016-11-09  Youenn Fablet  <you...@apple.com>
 
         [WebRTC] Introduce asynchronous backend for other RTCPeerConnection API

Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt (0 => 208447)


--- trunk/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-radius-expected.txt	2016-11-09 18:35:51 UTC (rev 208447)
@@ -0,0 +1,3 @@
+PASS: radiusX is 56.8
+PASS: radiusY is 56.8
+

Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-radius.html (0 => 208447)


--- trunk/LayoutTests/fast/events/touch/ios/touch-event-radius.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-radius.html	2016-11-09 18:35:51 UTC (rev 208447)
@@ -0,0 +1,104 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return `
+            (function() {
+                var eventStream = {
+                    events : [
+                        {
+                            inputType : "hand",
+                            timeOffset : 0,
+                            touches : [
+                                {
+                                    inputType : "finger",
+                                    phase : "began",
+                                    id : 1,
+                                    x : 20,
+                                    y : 40,
+                                    majorRadius: 0.10,
+                                    minorRadius: 0.10,
+                                }
+                            ]
+                        },
+                        {
+                            inputType : "hand",
+                            timeOffset : 0.0005,
+                            touches : [
+                                {
+                                    inputType : "finger",
+                                    phase : "ended",
+                                    id : 1,
+                                    x : 20,
+                                    y : 40,
+                                    majorRadius: 0.10,
+                                    minorRadius: 0.10,
+                                }
+                            ]
+                        },
+                    ]
+                };
+
+                uiController.sendEventStream(JSON.stringify(eventStream), function() {
+                    uiController.uiScriptComplete();
+                });
+            })();`
+        }
+
+        function runTest()
+        {
+            if (!testRunner.runUIScript)
+                return;
+
+            var output = '';
+            var target = document.getElementById('target');
+            var forces = [];
+            
+            target.addEventListener('touchstart', function(event) {
+                var expected = Math.round(0.10 * 568 * 10) / 10;
+                var radiusX = Math.round(event.touches[0].radiusX * 10) / 10;
+                if (radiusX == expected)
+                    output += 'PASS: radiusX is ' + expected + '<br>';
+                else
+                    output += 'FAIL: radiusX should be ' + expected + ', was ' + radiusX + '<br>';
+
+                var radiusY = Math.round(event.touches[0].radiusY * 10) / 10;
+                if (radiusY == expected)
+                    output += 'PASS: radiusY is ' + expected + '<br>';
+                else
+                    output += 'FAIL: radiusY should be ' + expected + ', was ' + radiusY + '<br>';
+            });
+            
+            if (testRunner.runUIScript) {
+                testRunner.runUIScript(getUIScript(), function(result) {
+                    document.getElementById('target').innerHTML = output;
+                    testRunner.notifyDone();
+               });
+            }
+        }
+
+        window.addEventListener('load', runTest, false);
+    </script>
+    <style>
+        #target {
+            height: 100px;
+            width: 200px;
+            background-color: silver;
+        }
+    </style>
+    <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+<div id="target">
+    This test requires UIScriptController to run.
+</div>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to