Title: [195158] trunk/LayoutTests
Revision
195158
Author
[email protected]
Date
2016-01-15 16:16:26 -0800 (Fri, 15 Jan 2016)

Log Message

Add a test for touch events in scaled documents
https://bugs.webkit.org/show_bug.cgi?id=153149
-and corresponding-
rdar://problem/24181371

Reviewed by Simon Fraser.

* fast/events/touch/ios/touch-event-in-scaled-document-expected.txt: Added.
* fast/events/touch/ios/touch-event-in-scaled-document.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195157 => 195158)


--- trunk/LayoutTests/ChangeLog	2016-01-16 00:08:44 UTC (rev 195157)
+++ trunk/LayoutTests/ChangeLog	2016-01-16 00:16:26 UTC (rev 195158)
@@ -1,3 +1,15 @@
+2016-01-15  Beth Dakin  <[email protected]>
+
+        Add a test for touch events in scaled documents
+        https://bugs.webkit.org/show_bug.cgi?id=153149
+        -and corresponding-
+        rdar://problem/24181371
+
+        Reviewed by Simon Fraser.
+
+        * fast/events/touch/ios/touch-event-in-scaled-document-expected.txt: Added.
+        * fast/events/touch/ios/touch-event-in-scaled-document.html: Added.
+
 2016-01-10  Simon Fraser  <[email protected]>
 
         Make a way to test display-list drawing

Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document-expected.txt (0 => 195158)


--- trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document-expected.txt	2016-01-16 00:16:26 UTC (rev 195158)
@@ -0,0 +1,3 @@
+Tap me
+Received event touchstart at 500, 650
+Done

Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document.html (0 => 195158)


--- trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-in-scaled-document.html	2016-01-16 00:16:26 UTC (rev 195158)
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="initial-scale=0.5,maximum-scale=2,minimum-scale=0.25,user-scalable=yes" />
+<style>
+#target {
+    width: 1200px;
+    height: 1200px;
+    border: 10px solid black;
+    background-color: silver;
+}
+        
+#target.tapped {
+    background-color: green;
+}
+</style>
+
+<script>
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function getUIScript()
+{
+    return `
+    (function() {
+        uiController.singleTapAtPoint(500, 650, function() {
+            uiController.uiScriptComplete("Done");
+        });
+    })();`
+}
+
+function setUp()
+{
+    var output = '';
+    var target = document.getElementById('target');
+    target.addEventListener('touchstart', function(event) {
+        output += 'Received event ' + event.type + ' at ' + event.touches[0].clientX + ', ' + event.touches[0].clientY + '<br>';
+        target.classList.toggle('tapped');
+    });
+
+    if (testRunner.runUIScript) {
+        testRunner.runUIScript(getUIScript(), function(result) {
+            output += result;
+            document.getElementById('console').innerHTML = output;
+            testRunner.notifyDone();
+        });
+    }
+}
+
+window.addEventListener('load', setUp, false);
+</script>
+</head>
+
+<body>
+<div id="target">Tap me</div>
+<pre id="console">To test manually, tap the box. If it turns green, then the test passes.</pre>
+</body>
+
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to