blob: c67ebbbd7a5cd692339ef298cb215fe85d8a96ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<!DOCTYPE html>
<script src="resources/file-drag-common.js"></script>
<html>
<head>
</head>
<body>
<form id="form">
<input id="file" type="file" />
<input id="reset" type="reset" />
</form>
<div id="console"></div>
<p>
This tests whether the label next to the file chooser button becomes "No file chosen"
when we press the reset button.
To run this test manually, choose a file and then click the reset button.
If the label next to the file chooser button changes to "No file chosen", the test passes.
</p>
<script>
if (testRunner && eventSender) {
var file = document.getElementById("file");
var reset = document.getElementById("reset");
dragFilesOntoElement(file, ["foo.txt"]);
document.getElementById("console").innerHTML = file.value + " is selected.";
click(reset.offsetLeft + reset.offsetWidth / 2, reset.offsetTop + reset.offsetHeight / 2);
click(reset.offsetLeft + reset.offsetWidth + 10, reset.offsetTop + reset.offsetHeight + 10); // Move a cursor out of the reset button.
}
function click(x, y) {
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseMoveTo(x, y);
eventSender.mouseUp();
}
</script>
</body>
</html>
|