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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body onload="test()">
7 <p>This test checks long press behavior when both touch drag/drop and touch edit ing are enabled.<br>
8 1. Check that long press on a draggable element starts drag.<br>
9 2. Check that long press on non-draggable text selects the text.<br>
10 3. Check that long press on selected text starts drag.</p>
11 <div id="text">Testing</div>
12 <div id="draggableDivResult">FAIL</div>
13 <div id="selectTextResult">FAIL</div>
14 <div id="draggableTextResult">FAIL</div>
15 <div id="draggableDiv" draggable='true'>Drag me</div>
16 <div id="textDiv">Some text</div>
17 <script>
18 function test()
19 {
20 if (window.testRunner)
21 testRunner.dumpAsText();
22
23 if (window.internals) {
24 internals.settings.setTouchDragDropEnabled(true);
25 internals.settings.setTouchEditingEnabled(true);
26 }
27
28 var draggableDiv = document.getElementById("draggableDiv");
29 draggableDiv.ondragstart = function() { document.getElementById("draggableDi vResult").innerHTML = "PASS"; }
30
31 var textDiv = document.getElementById("textDiv");
32 textDiv.ondragstart = function() { document.getElementById("draggableTextRes ult").innerHTML = "PASS"; }
33
34 if (!window.eventSender)
35 return;
36 if (eventSender.gestureLongPress) {
37 var x = draggableDiv.offsetParent.offsetLeft + draggableDiv.offsetLeft + 4;
38 var y = draggableDiv.offsetParent.offsetTop + draggableDiv.offsetTop + d raggableDiv.offsetHeight / 2;
39 eventSender.gestureLongPress(x, y);
40
41 x = textDiv.offsetParent.offsetLeft + textDiv.offsetLeft + 4;
42 y = textDiv.offsetParent.offsetTop + textDiv.offsetTop + textDiv.offsetH eight / 2;
43
44 eventSender.gestureLongPress(x, y);
45 if (document.getSelection().toString().length > 0)
46 document.getElementById("selectTextResult").innerHTML = "PASS";
47
48 eventSender.gestureLongPress(x, y);
49 } else {
50 debug("gestureLongPress not implemented by this platform");
51 return;
52 }
53 }
54 </script>
55 </body>
56 </html>
OLDNEW
« 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