OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 onload = function() { | 4 onload = function() { |
5 if (!window.eventSender || !window.eventSender.gestureLongPress) { | 5 if (!window.eventSender || !window.eventSender.gestureLongPress) { |
6 debug("gestureLongPress not implemented by this platform."); | 6 debug("gestureLongPress not implemented by this platform."); |
7 debug("Manullay long press on every element in the page and check whethe
r Text selection is happening or not"); | 7 debug("Manullay long press on every element in the page and check whethe
r Text selection is happening or not"); |
8 debug("If Text selection is not happening for readonly or disabled input
/textarea, then it's a failure."); | 8 debug("If Text selection is not happening for readonly input/textarea, t
hen it's a failure."); |
9 return; | 9 return; |
10 } | 10 } |
11 | 11 |
12 doLongPressOnElement("normalText"); | 12 doLongPressOnElement("normalText"); |
13 | 13 |
14 doLongPressOnElement("readOnlyText"); | 14 doLongPressOnElement("readOnlyText"); |
15 | 15 |
16 doLongPressOnElement("disabledText"); | 16 doLongPressOnElement("disabledText"); |
17 | 17 |
18 doLongPressOnElement("readOnlyDisabledText"); | 18 doLongPressOnElement("readOnlyDisabledText"); |
(...skipping 11 matching lines...) Expand all Loading... |
30 var element = document.getElementById(elementId); | 30 var element = document.getElementById(elementId); |
31 var bounds = element.getBoundingClientRect(); | 31 var bounds = element.getBoundingClientRect(); |
32 var x = bounds.left + 5; | 32 var x = bounds.left + 5; |
33 var y = bounds.top + 5; | 33 var y = bounds.top + 5; |
34 window.eventSender.gestureLongPress(x, y); | 34 window.eventSender.gestureLongPress(x, y); |
35 shouldBeEqualToString('window.getSelection().toString()', element.value); | 35 shouldBeEqualToString('window.getSelection().toString()', element.value); |
36 } | 36 } |
37 </script> | 37 </script> |
38 <input id="normalText" type="text" value="NormalInput"> | 38 <input id="normalText" type="text" value="NormalInput"> |
39 <input id="readOnlyText" type="text" value="ReadonlyInput" readonly> | 39 <input id="readOnlyText" type="text" value="ReadonlyInput" readonly> |
40 <input id="disabledText" type="text" value="DisabledInput" disabled> | 40 <input id="disabledText" type="text" value="" disabled> |
41 <input id="readOnlyDisabledText" size="20" type="text" value="ReadonlyDisabledIn
put"readonly disabled> | 41 <input id="readOnlyDisabledText" size="20" type="text" value=""readonly disabled
> |
42 <textarea id="normalTextArea" cols="31">NormalTextarea</textarea> | 42 <textarea id="normalTextArea" cols="31">NormalTextarea</textarea> |
43 <textarea id="readOnlyTextArea" cols="31" readonly>ReadonlyTextarea</textarea> | 43 <textarea id="readOnlyTextArea" cols="31" readonly>ReadonlyTextarea</textarea> |
44 <textarea id="disabledTextArea" cols="31" disabled>DisabledTextarea</textarea> | 44 <textarea id="disabledTextArea" cols="31" disabled></textarea> |
45 <textarea id="readOnlyDisabledTextArea" cols="31" readonly disabled>ReadonlyDisa
bledTextarea</textarea> | 45 <textarea id="readOnlyDisabledTextArea" cols="31" readonly disabled></textarea> |
46 | 46 |
OLD | NEW |