OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../js/resources/js-test-pre.js"></script> |
4 <script> | 4 <script> |
5 description("Tests the capture attribute of <input type='file'>"); | 5 description("Tests the capture attribute of <input type='file'>"); |
6 | 6 |
7 var input = document.createElement("input"); | 7 var input = document.createElement("input"); |
8 | 8 |
9 shouldBeTrue("'capture' in input"); | 9 shouldBeTrue("'capture' in input"); |
10 shouldBe("input.capture", "''"); | 10 shouldBe("input.capture", "false"); |
| 11 shouldBe("input.hasAttribute('capture')", "false"); |
11 | 12 |
12 input.setAttribute("type", "file"); | 13 input.setAttribute("type", "file"); |
13 | 14 |
14 shouldBe("input.capture", "'filesystem'"); | 15 shouldBe("input.capture", "false"); |
| 16 shouldBe("input.hasAttribute('capture')", "false"); |
15 | 17 |
16 input.setAttribute("capture", "CaMerA"); | 18 input.setAttribute("capture", true); |
17 shouldBe("input.capture", "'camera'"); | 19 shouldBe("input.capture", "true"); |
| 20 shouldBe("input.hasAttribute('capture')", "true"); |
18 | 21 |
19 input.setAttribute("capture", "camcorder"); | 22 input.removeAttribute("capture"); |
20 shouldBe("input.capture", "'camcorder'"); | 23 shouldBe("input.capture", "false"); |
| 24 shouldBe("input.hasAttribute('capture')", "false"); |
21 | 25 |
22 input.setAttribute("capture", "MiCroPhonE"); | 26 input.setAttribute("capture", "'x'"); |
23 shouldBe("input.capture", "'microphone'"); | 27 shouldBe("input.capture", "true"); |
| 28 shouldBe("input.hasAttribute('capture')", "true"); |
24 | 29 |
25 input.setAttribute("capture", "xyzzy"); | 30 input.capture = false; |
26 shouldBe("input.capture", "'filesystem'"); | 31 shouldBe("input.capture", "false"); |
| 32 shouldBe("input.hasAttribute('capture')", "false"); |
27 | 33 |
28 input.capture = "CamCorder"; | 34 input.capture = true; |
29 shouldBe("input.capture", "'camcorder'"); | 35 shouldBe("input.capture", "true"); |
30 shouldBe("input.getAttribute('capture')", "'CamCorder'"); | 36 shouldBe("input.hasAttribute('capture')", "true"); |
31 | |
32 </script> | 37 </script> |
33 <script src="../../js/resources/js-test-post.js"></script> | 38 <script src="../../js/resources/js-test-post.js"></script> |
34 </html> | 39 </html> |
OLD | NEW |