2 <script src=
"resources/file-drag-common.js"></script>
8 <input id=
"file" type=
"file" />
9 <input id=
"reset" type=
"reset" />
11 <div id=
"console"></div>
13 This tests whether the label next to the file chooser button becomes
"No file chosen"
14 when we press the reset button.
15 To run this test manually, choose a file and then click the reset button.
16 If the label next to the file chooser button changes to
"No file chosen", the test passes.
19 if (testRunner
&& eventSender
) {
20 var file
= document
.getElementById("file");
21 var reset
= document
.getElementById("reset");
22 dragFilesOntoElement(file
, ["foo.txt"]);
23 document
.getElementById("console").innerHTML
= file
.value
+ " is selected.";
24 click(reset
.offsetLeft
+ reset
.offsetWidth
/ 2, reset
.offsetTop
+ reset
.offsetHeight
/ 2);
25 click(reset
.offsetLeft
+ reset
.offsetWidth
+ 10, reset
.offsetTop
+ reset
.offsetHeight
+ 10); // Move a cursor out of the reset button.
28 function click(x
, y
) {
29 eventSender
.mouseMoveTo(x
, y
);
30 eventSender
.mouseDown();
31 eventSender
.mouseMoveTo(x
, y
);
32 eventSender
.mouseUp();