<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description("Tests that the input type can be set to 'file' after having been set to another type");

var input = document.createElement("input");
shouldBeEqualToString("input.type", "text");
shouldBeNull("input.getAttribute('type')");

evalAndLog("input.setAttribute('type', 'radio')");
shouldBeEqualToString("input.type", "radio");
shouldBeEqualToString("input.getAttribute('type')", "radio");

evalAndLog("input.setAttribute('type', 'file')");
shouldBeEqualToString("input.type", "file");
shouldBeEqualToString("input.getAttribute('type')", "file");

evalAndLog("input.type = 'radio'");
shouldBeEqualToString("input.type", "radio");
shouldBeEqualToString("input.getAttribute('type')", "radio");

evalAndLog("input.type = 'file'");
shouldBeEqualToString("input.type", "file");
shouldBeEqualToString("input.getAttribute('type')", "file");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
