4 <script src=
"../../resources/js-test.js"></script>
9 testRunner
.dumpAsText();
11 if (!window
.eventSender
)
14 if (!window
.eventSender
.gestureLongPress
) {
15 debug("gestureLongPress not implemented by this platform.");
16 debug("Manullay long press on every element in the page and check whether Paste Popup is appearing or not");
17 debug("If Paste popup is appearing for readonly or disabled input/textarea, then it's a failure.");
22 doLongPressOnElement("normalText");
25 doLongPressOnElement("readOnlyText");
28 doLongPressOnElement("disabledText");
30 // ReadOnly and Disabled Text
31 doLongPressOnElement("readOnlyDisabledText");
34 doLongPressOnElement("normalTextArea");
37 doLongPressOnElement("readOnlyTextArea");
40 doLongPressOnElement("disabledTextArea");
42 // ReadOnly and Disabled TextArea
43 doLongPressOnElement("readOnlyDisabledTextArea");
48 function doLongPressOnElement(elementId
) {
49 var element
= document
.getElementById(elementId
);
50 var bounds
= element
.getBoundingClientRect();
51 var middleX
= (bounds
.left
+ bounds
.right
) / 2;
52 var middleY
= (bounds
.top
+ bounds
.bottom
) / 2;
53 // Touch directly in the center of the element.
54 window
.eventSender
.gestureLongPress(middleX
, middleY
);
55 var touchNode
= document
.elementFromPoint(middleX
, middleY
);
56 shouldBe(touchNode
.id
, elementId
);
60 <body onload=
"test();">
61 <input id=
"normalText" type=
"text" value=
"Normal input">
62 <input id=
"readOnlyText" type=
"text" value=
"Readonly input" readonly
>
63 <input id=
"disabledText" type=
"text" value=
"Disabled input" disabled
>
64 <input id=
"readOnlyDisabledText" size=
"20" type=
"text" value=
"Readonly Disabled input"readonly disabled
>
65 <textarea id=
"normalTextArea" cols=
"31">Normal textarea
</textarea>
66 <textarea id=
"readOnlyTextArea" cols=
"31" readonly
>Readonly textarea
</textarea>
67 <textarea id=
"disabledTextArea" cols=
"31" disabled
>Disabled textarea
</textarea>
68 <textarea id=
"readOnlyDisabledTextArea" cols=
"31" readonly disabled
>Readonly Disabled textarea
</textarea>