blob: 9d29da756066d5c767379fbf969ecbe6e03877fd [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<iframe id="formiframe" name="formiframe"></iframe>
<form target="formiframe" id="myform" action="/forms/resources/return-content-type.php" enctype="multipart/form-data" method="post">
<input type="text" name="textinput" value="hello world">
<input type="file" name="fileinput" id="fileinput">
<input type="submit">
</form>
<script>
window.test(() => {
if (!window.eventSender)
return;
const fileinput = document.getElementById('fileinput');
window.eventSender.beginDragWithFiles(['resources/hello_world.xls']);
const centerx = fileinput.offsetLeft + fileinput.offsetWidth / 2;
const centery = fileinput.offsetTop + fileinput.offsetHeight / 2;
window.eventSender.mouseMoveTo(centerx, centery);
window.eventSender.mouseUp();
assert_equals(fileinput.files[0].type, 'application/vnd.ms-excel');
});
</script>
</body>