3 <script src=
"../../../resources/js-test.js"></script>
5 description("Tests the capture attribute of <input type='file'>");
7 var input
= document
.createElement("input");
9 shouldBeTrue("'capture' in input");
10 shouldBe("input.capture", "false");
11 shouldBe("input.hasAttribute('capture')", "false");
13 input
.setAttribute("type", "file");
15 shouldBe("input.capture", "false");
16 shouldBe("input.hasAttribute('capture')", "false");
18 input
.setAttribute("capture", true);
19 shouldBe("input.capture", "true");
20 shouldBe("input.hasAttribute('capture')", "true");
22 input
.removeAttribute("capture");
23 shouldBe("input.capture", "false");
24 shouldBe("input.hasAttribute('capture')", "false");
26 input
.setAttribute("capture", "'x'");
27 shouldBe("input.capture", "true");
28 shouldBe("input.hasAttribute('capture')", "true");
30 input
.capture
= false;
31 shouldBe("input.capture", "false");
32 shouldBe("input.hasAttribute('capture')", "false");
35 shouldBe("input.capture", "true");
36 shouldBe("input.hasAttribute('capture')", "true");