Convert focused-input-should-assist-on-touch.html into an automated test
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Oct 2015 04:27:32 +0000 (04:27 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Oct 2015 04:27:32 +0000 (04:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149724

Reviewed by Simon Fraser.

.:

Remove a manual test that can now be rewritten as an automated test.

* ManualTests/ios/focused-input-should-assist-on-touch.html: Removed.

LayoutTests:

Tests that an input that focuses itself on touch and then prevents default is
able to trigger node assistance, even when it is already focused before the
user gesture.

* fast/events/ios/focused-input-should-assist-on-touch-expected.txt: Added.
* fast/events/ios/focused-input-should-assist-on-touch.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/events/ios/focused-input-should-assist-on-touch-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/focused-input-should-assist-on-touch.html [new file with mode: 0644]
ManualTests/ios/focused-input-should-assist-on-touch.html [deleted file]

index 8d9cb3b..a5a4fdb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-10-01  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Convert focused-input-should-assist-on-touch.html into an automated test
+        https://bugs.webkit.org/show_bug.cgi?id=149724
+
+        Reviewed by Simon Fraser.
+
+        Remove a manual test that can now be rewritten as an automated test.
+
+        * ManualTests/ios/focused-input-should-assist-on-touch.html: Removed.
+
 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Unreviewed CMake build fix.
index 8f6fed3..0c189ed 100644 (file)
@@ -1,3 +1,17 @@
+2015-10-01  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Convert focused-input-should-assist-on-touch.html into an automated test
+        https://bugs.webkit.org/show_bug.cgi?id=149724
+
+        Reviewed by Simon Fraser.
+
+        Tests that an input that focuses itself on touch and then prevents default is
+        able to trigger node assistance, even when it is already focused before the
+        user gesture.
+
+        * fast/events/ios/focused-input-should-assist-on-touch-expected.txt: Added.
+        * fast/events/ios/focused-input-should-assist-on-touch.html: Added.
+
 2015-10-01  Dean Jackson  <dino@apple.com>
 
         Rollout r190446 for the moment. It broke the build.
diff --git a/LayoutTests/fast/events/ios/focused-input-should-assist-on-touch-expected.txt b/LayoutTests/fast/events/ios/focused-input-should-assist-on-touch-expected.txt
new file mode 100644 (file)
index 0000000..fa92c32
--- /dev/null
@@ -0,0 +1,2 @@
+
+Successfully showed keyboard.
diff --git a/LayoutTests/fast/events/ios/focused-input-should-assist-on-touch.html b/LayoutTests/fast/events/ios/focused-input-should-assist-on-touch.html
new file mode 100644 (file)
index 0000000..d53af72
--- /dev/null
@@ -0,0 +1,62 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <meta name="viewport" content="initial-scale=1.0">
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didShowKeyboardCallback = function() {
+                uiController.uiScriptComplete("Successfully showed keyboard.");
+            }
+            uiController.singleTapAtPoint(50, 25, function() { });
+        })();
+    </script>
+
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function handleTouchEvent(event)
+        {
+            event.target.focus();
+            event.preventDefault();
+        }
+
+        function runTest()
+        {
+            if (window.testRunner && testRunner.runUIScript)
+                testRunner.runUIScript(getUIScript(), function(result) {
+                    document.getElementById("console").textContent = result;
+                    testRunner.notifyDone();
+                });
+            else
+                document.getElementById("console").textContent = "This tests that a node can be assisted when focused due to a touch event, even when the focus does not change. Tapping the below input should show the keyboard. Best run using WKTR."
+        }
+    </script>
+
+    <style>
+        input:focus {
+            outline: none;
+            border: 1px solid #4D90FE;
+        }
+
+        input {
+            width: 100px;
+            height: 50px;
+        }
+    </style>
+
+</head>
+
+<body style="margin: 0;" onload="runTest()">
+    <input autofocus ontouchstart="handleTouchEvent(event)"></input>
+    <div id="console">Failed to show keyboard.</div>
+</body>
+</html>
diff --git a/ManualTests/ios/focused-input-should-assist-on-touch.html b/ManualTests/ios/focused-input-should-assist-on-touch.html
deleted file mode 100644 (file)
index 4238cf3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<html>
-<head>
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <script>
-        function handleTouchEvent(event) {
-            event.target.focus();
-            event.preventDefault();
-        }
-    </script>
-
-    <style>
-        input:focus {
-            outline: none;
-            border: 1px solid #4D90FE;
-        }
-    </style>
-
-</head>
-
-<body style="margin: 0;">
-    <p>This tests checks that a node can be assisted when focused due to a touch event, even when the focus does not change.</p>
-    <p>Tapping the below input should show the keyboard.</p>
-    <input autofocus ontouchstart="handleTouchEvent(event);"></input>
-</body>
-</html>