40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<script src="../../../resources/js-test-pre.js"></script>
|
|
<script>
|
|
description("Tests the capture attribute of <input type='file'>");
|
|
|
|
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>
|