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

Unified Diff: LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined.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
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined.html
diff --git a/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined.html b/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined.html
new file mode 100644
index 0000000000000000000000000000000000000000..bbdf4b4fd2138447e51034cc0a8cc6bd13a8d9ca
--- /dev/null
+++ b/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined.html
@@ -0,0 +1,56 @@
+<!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 long press behavior when both touch drag/drop and touch editing are enabled.<br>
+1. Check that long press on a draggable element starts drag.<br>
+2. Check that long press on non-draggable text selects the text.<br>
+3. Check that long press on selected text starts drag.</p>
+<div id="text">Testing</div>
+<div id="draggableDivResult">FAIL</div>
+<div id="selectTextResult">FAIL</div>
+<div id="draggableTextResult">FAIL</div>
+<div id="draggableDiv" draggable='true'>Drag me</div>
+<div id="textDiv">Some text</div>
+<script>
+function test()
+{
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (window.internals) {
+ internals.settings.setTouchDragDropEnabled(true);
+ internals.settings.setTouchEditingEnabled(true);
+ }
+
+ var draggableDiv = document.getElementById("draggableDiv");
+ draggableDiv.ondragstart = function() { document.getElementById("draggableDivResult").innerHTML = "PASS"; }
+
+ var textDiv = document.getElementById("textDiv");
+ textDiv.ondragstart = function() { document.getElementById("draggableTextResult").innerHTML = "PASS"; }
+
+ if (!window.eventSender)
+ return;
+ if (eventSender.gestureLongPress) {
+ var x = draggableDiv.offsetParent.offsetLeft + draggableDiv.offsetLeft + 4;
+ var y = draggableDiv.offsetParent.offsetTop + draggableDiv.offsetTop + draggableDiv.offsetHeight / 2;
+ eventSender.gestureLongPress(x, y);
+
+ x = textDiv.offsetParent.offsetLeft + textDiv.offsetLeft + 4;
+ y = textDiv.offsetParent.offsetTop + textDiv.offsetTop + textDiv.offsetHeight / 2;
+
+ eventSender.gestureLongPress(x, y);
+ if (document.getSelection().toString().length > 0)
+ document.getElementById("selectTextResult").innerHTML = "PASS";
+
+ eventSender.gestureLongPress(x, y);
+ } else {
+ debug("gestureLongPress not implemented by this platform");
+ return;
+ }
+}
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698