chromium/third_party/blink/web_tests/fast/forms/input-file-set-value.html

<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>

<body>

<script>
description("Tests that setting the value of input type=file throws and changing type resets.");

input = document.createElement("input");
document.body.appendChild(input);

input.value = "example.txt";
shouldBeEqualToString("input.value", "example.txt");
input.type = "file";
shouldBeEqualToString("input.value", "");
shouldThrow('input.value = "foo"', '"InvalidStateError: Failed to set the \'value\' property on \'HTMLInputElement\': This input element accepts a filename, which may only be programmatically set to the empty string."');
input.value = "";
</script>