OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <p> | 6 <p> |
7 This test checks that on a long press or a two finger tap gesture in a text area
, | 7 This test checks that on a long press or a two finger tap gesture in a text area
, |
8 the cursor is first set to the right position (this is done by sending a right | 8 the cursor is first set to the right position (this is done by sending a right |
9 mouse button down event just before long press). | 9 mouse button down event just before long press). |
10 </p> | 10 </p> |
11 <textarea id="text" rows="5" cols="31"> | 11 <textarea id="text" rows="5" cols="31"> |
12 This test checks that on a long press or a two finger tap gesture in a text area
, | 12 This test checks that on a long press or a two finger tap gesture in a text area
, |
13 the cursor is first set to the right position (this is done by sending a right | 13 the cursor is first set to the right position (this is done by sending a right |
14 mouse button down event just before long press). | 14 mouse button down event just before long press). |
15 </textarea> | 15 </textarea> |
16 <div id="text">Testing</div> | 16 <div id="text">Testing</div> |
17 <div id="result">FAIL</div> | 17 <div id="result">FAIL</div> |
18 <script> | 18 <script> |
19 function setCursorPosition(position) | 19 function setCursorPosition(position) |
20 { | 20 { |
21 var text = document.getElementById("text"); | 21 var text = document.getElementById("text"); |
22 text.focus(); | 22 text.focus(); |
23 text.setSelectionRange(position, position); | 23 text.setSelectionRange(position, position); |
24 } | 24 } |
25 | 25 |
26 if (window.testRunner) | 26 if (window.testRunner) |
27 testRunner.dumpAsText(); | 27 testRunner.dumpAsText(); |
28 | 28 |
| 29 if (window.internals) |
| 30 internals.settings.setTouchEditingEnabled(false); |
| 31 |
29 var text = document.getElementById("text"); | 32 var text = document.getElementById("text"); |
30 | 33 |
31 setCursorPosition(0); | 34 setCursorPosition(0); |
32 | 35 |
33 var longPressTested = false; | 36 var longPressTested = false; |
34 document.oncontextmenu = function() { | 37 document.oncontextmenu = function() { |
35 if (longPressTested && text.selectionStart != 0) | 38 if (longPressTested && text.selectionStart != 0) |
36 document.getElementById("result").innerHTML = "PASS"; | 39 document.getElementById("result").innerHTML = "PASS"; |
37 | 40 |
38 if (!longPressTested && text.selectionStart != 0) { | 41 if (!longPressTested && text.selectionStart != 0) { |
(...skipping 14 matching lines...) Expand all Loading... |
53 debug("gestureLongPress not implemented by this platform"); | 56 debug("gestureLongPress not implemented by this platform"); |
54 | 57 |
55 if (eventSender.gestureTwoFingerTap) | 58 if (eventSender.gestureTwoFingerTap) |
56 eventSender.gestureTwoFingerTap(x + 20, y); | 59 eventSender.gestureTwoFingerTap(x + 20, y); |
57 else | 60 else |
58 debug("gestureTwoFingerTap not implemented by this platform"); | 61 debug("gestureTwoFingerTap not implemented by this platform"); |
59 } | 62 } |
60 </script> | 63 </script> |
61 </body> | 64 </body> |
62 </html> | 65 </html> |
OLD | NEW |