1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../../resources/js-test.js"></script>
7 <p>This test checks that a long press gesture selects word when touch editing is enabled.
</p>
8 <div id=
"text">Testing
</div>
9 <div id=
"result">FAIL
</div>
10 <div id=
"textDiv">Some text
</div>
14 if (window
.testRunner
)
15 testRunner
.dumpAsText();
18 internals
.settings
.setTouchEditingEnabled(true);
20 var textDiv
= document
.getElementById("textDiv");
22 var x
= textDiv
.offsetParent
.offsetLeft
+ textDiv
.offsetLeft
+ 4;
23 var y
= textDiv
.offsetParent
.offsetTop
+ textDiv
.offsetTop
+ textDiv
.offsetHeight
/ 2;
25 if (!window
.eventSender
)
27 if (eventSender
.gestureLongPress
) {
28 eventSender
.gestureLongPress(x
, y
);
29 var selectedText
= document
.getSelection();
30 if (selectedText
.toString().length
> 0)
31 document
.getElementById("result").innerHTML
= "PASS";
33 debug("gestureLongPress not implemented by this platform");