<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script src="resources/file-drag-common.js"></script>
<form method="GET" onsubmit="finish(false)">
<input type="file" oninvalid="finish(true)" required>
<input type="submit">
</form>
<pre id="console"></pre>
<script>
description("This tests that a file input cleared of its (required) value doesn't validate.");
var invalid = false;
function finish(pass)
{
invalid = pass;
shouldBeTrue("invalid");
finishJSTest();
}
function startTest()
{
dragFilesOntoInput(document.forms[0].querySelector("[type=file]"), ['file-input-empty-validation.html']);
document.forms[0].querySelector("[type=file]").value = "";
document.forms[0].querySelector("[type=submit]").click();
}
if (window.eventSender) {
window.jsTestIsAsync = true;
testRunner.dumpAsText();
window.onload = startTest;
}
</script>