Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html

Issue 14089009: Change long press behavior when touch text selection is enabled: (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html
diff --git a/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html b/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html
new file mode 100644
index 0000000000000000000000000000000000000000..6a6aaee76835fde896f84ea8a0ccc7ca90d19b36
--- /dev/null
+++ b/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="test()">
+<p>This test checks that a long press gesture selects word when touch editing is enabled.</p>
+<div id="text">Testing</div>
+<div id="result">FAIL</div>
+<div id="textDiv">Some text</div>
+<script>
+function test()
+{
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (window.internals)
+ internals.settings.setTouchEditingEnabled(true);
+
+ var textDiv = document.getElementById("textDiv");
+
+ var x = textDiv.offsetParent.offsetLeft + textDiv.offsetLeft + 4;
+ var y = textDiv.offsetParent.offsetTop + textDiv.offsetTop + textDiv.offsetHeight / 2;
+
+ if (!window.eventSender)
+ return;
+ if (eventSender.gestureLongPress) {
+ eventSender.gestureLongPress(x, y);
+ var selectedText = document.getSelection();
+ if (selectedText.toString().length > 0)
+ document.getElementById("result").innerHTML = "PASS";
+ } else {
+ debug("gestureLongPress not implemented by this platform");
+ return;
+ }
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698