OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <meta charset=utf-8> |
| 3 <title>HTMLInputElement#files</title> |
| 4 <script src="../../../../../../resources/testharness.js"></script> |
| 5 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 6 <div id=log></div> |
| 7 <script> |
| 8 var types = [ |
| 9 "hidden", |
| 10 "text", |
| 11 "search", |
| 12 "tel", |
| 13 "url", |
| 14 "email", |
| 15 "password", |
| 16 "datetime", |
| 17 "date", |
| 18 "month", |
| 19 "week", |
| 20 "time", |
| 21 "datetime-local", |
| 22 "number", |
| 23 "range", |
| 24 "color", |
| 25 "checkbox", |
| 26 "radio", |
| 27 "submit", |
| 28 "image", |
| 29 "reset", |
| 30 "button", |
| 31 ]; |
| 32 |
| 33 types.forEach(function(type) { |
| 34 test(function() { |
| 35 var input = document.createElement("input"); |
| 36 input.type = type; |
| 37 assert_equals(input.files, null, "files should be null"); |
| 38 }, "files for input type=" + type); |
| 39 }); |
| 40 |
| 41 test(function() { |
| 42 var input = document.createElement("input"); |
| 43 input.type = "file"; |
| 44 assert_not_equals(input.files, null); |
| 45 assert_true(input.files instanceof FileList, "files should be a FileList"); |
| 46 var files = input.files; |
| 47 assert_equals(input.files, files, "files should return the same object"); |
| 48 }, "files for input type=file"); |
| 49 </script> |
OLD | NEW |