6 testRunner
.dumpAsText();
7 var tf
= document
.getElementById('tf');
8 var x
= tf
.offsetLeft
+ tf
.offsetWidth
/ 2;
9 var y
= tf
.offsetTop
+ tf
.offsetHeight
/ 2;
10 if (window
.eventSender
) {
11 eventSender
.mouseMoveTo(x
, y
);
12 eventSender
.mouseDown();
13 eventSender
.mouseUp();
15 if (tf
.selectionStart
== 0 && tf
.selectionEnd
== 10) { // ;
16 document
.getElementById("result").innerHTML
= "PASS";
18 document
.getElementById("result").innerHTML
= "FAIL: selection start is "
19 + tf
.selectionStart
+ " and end is " + tf
.selectionEnd
+ ".";
24 <body onload=
"test()">
25 <p>Tests behavior of code that calls select() inside an onclick handler. The entire field should end up selected.
</p>
26 <p>The test runs only under DumpRenderTree with eventSender; if you test by hand the test result below will say FAIL.
</p>
27 <p><input type=
"text" id=
"tf" onclick=
"this.select()" value=
"input text"></input></p>
28 <p id=
"result">TEST NOT RUN YET
</p>