Title: [242800] trunk/LayoutTests
Revision
242800
Author
[email protected]
Date
2019-03-12 10:23:00 -0700 (Tue, 12 Mar 2019)

Log Message

[iOS] Add test to ensure that a web page can prevent the default for Command + A
https://bugs.webkit.org/show_bug.cgi?id=192425

Reviewed by Wenson Hsieh.

Skip the test until we have the UIKit fix for <rdar://problem/46430796>.

* fast/events/ios/key-command-select-all-prevent-default.html: Added.
* platform/ios/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (242799 => 242800)


--- trunk/LayoutTests/ChangeLog	2019-03-12 17:22:55 UTC (rev 242799)
+++ trunk/LayoutTests/ChangeLog	2019-03-12 17:23:00 UTC (rev 242800)
@@ -1,3 +1,15 @@
+2019-03-12  Daniel Bates  <[email protected]>
+
+        [iOS] Add test to ensure that a web page can prevent the default for Command + A
+        https://bugs.webkit.org/show_bug.cgi?id=192425
+
+        Reviewed by Wenson Hsieh. 
+
+        Skip the test until we have the UIKit fix for <rdar://problem/46430796>.
+
+        * fast/events/ios/key-command-select-all-prevent-default.html: Added.
+        * platform/ios/TestExpectations:
+
 2019-03-12  Zalan Bujtas  <[email protected]>
 
         [Synthetic Click] Dispatch mouseout soon after mouseup

Added: trunk/LayoutTests/fast/events/ios/key-command-select-all-prevent-default.html (0 => 242800)


--- trunk/LayoutTests/fast/events/ios/key-command-select-all-prevent-default.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/key-command-select-all-prevent-default.html	2019-03-12 17:23:00 UTC (rev 242800)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+window.jsTestIsAsync = true;
+
+let testElement;
+
+function handleKeyDown(event)
+{
+    if (!event.metaKey || event.key !== "a")
+        return;
+
+    event.preventDefault();
+    testElement.removeEventListener("keydown", handleKeyDown, true);
+
+    shouldBeEqualToString("window.getSelection().type", "Caret");
+    document.body.removeChild(testElement); // To make the output pretty.
+    finishJSTest();
+}
+
+function handleFocus()
+{
+    testElement.addEventListener("keydown", handleKeyDown, true);
+    if (window.testRunner)
+        UIHelper.keyDown("a", ["metaKey"]);
+}
+
+function runTest()
+{
+    testElement = document.getElementById("test");
+
+    description("Tests that preventDefault() when Command + A is pressed prevents selection.");
+
+    testElement.addEventListener("focus", handleFocus, { once: true });
+    if (window.testRunner)
+        UIHelper.activateFormControl(testElement);
+    else
+        testElement.focus();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<div id="test" contenteditable="true">Press Command + A to select all this text.</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios/TestExpectations (242799 => 242800)


--- trunk/LayoutTests/platform/ios/TestExpectations	2019-03-12 17:22:55 UTC (rev 242799)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2019-03-12 17:23:00 UTC (rev 242800)
@@ -3237,4 +3237,7 @@
 fast/events/ios/activating-reset-button-should-not-scroll-page.html [ Skip ]
 fast/events/ios/activating-submit-button-should-not-scroll-page.html [ Skip ]
 
+# FIXME: Unskip the following test once we have the fix for <rdar://problem/45892362>.
+fast/events/ios/key-command-select-all-prevent-default.html [ Skip ]
+
 webkit.org/b/195433 imported/w3c/web-platform-tests/webrtc/simplecall-no-ssrcs.https.html [ Skip ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to