blob: 85cb97a26c2186e4dbd27f06a6862c938a31d691 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description("Tests the capture attribute of &lt;input type='file'&gt;");
var input = document.createElement("input");
shouldBeTrue("'capture' in input");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("type", "file");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("capture", true);
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
input.removeAttribute("capture");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("capture", "'x'");
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
input.capture = false;
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.capture = true;
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
</script>
<script src="../../../resources/js-test-post.js"></script>
</html>