Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-multiple.html
blobe6d924bd143488167c5407091e67922a393225b7
1 <html>
2 <head>
3 <script>
4 function log(msg)
6 document.getElementById("console").appendChild(document.createTextNode(msg + "\n"));
9 function check(testNum, expected, actual)
11 var msg = "Test " + testNum;
12 if (expected == actual)
13 msg += " passed.";
14 else
15 msg += " failed. Expected: " + expected + " Actual: " + actual;
16 log(msg);
19 function test()
21 if (window.testRunner)
22 testRunner.dumpAsText();
24 var up1 = document.getElementById("up1");
25 var up2 = document.getElementById("up2");
27 check(1, up1.multiple, true);
28 check(2, up2.multiple, false);
30 up1.multiple = false;
31 up2.multiple = true;
33 check(3, up1.multiple, false);
34 check(4, up2.multiple, true);
36 check(5, up1.getAttribute("multiple"), null);
37 check(6, up2.getAttribute("multiple"), "");
39 </script>
40 </head>
41 <body onload="test()">
42 This tests that you can get and set the multiple attribute as a property in JavaScript.<br>
43 <input type="file" id="up1" multiple>
44 <input type="file" id="up2">
45 <pre id="console"></pre>
46 </body>
47 </html>