OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <input type="file" multiple onchange="onInputFileChange(this.files)"> | 7 <input type="file" multiple onchange="onInputFileChange(this.files)"> |
8 <div id="description"></div> | 8 <div id="description"></div> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 <script> | 10 <script> |
11 description("Test the attribute of FileList."); | 11 description("Test the attribute of FileList."); |
12 | 12 |
13 debug("Start"); | 13 debug("Start"); |
14 | 14 |
15 function onInputFileChange(files) | 15 function onInputFileChange(files) |
16 { | 16 { |
17 window.files = files; | 17 window.files = files; |
| 18 shouldBeTrue("files instanceof FileList"); |
18 shouldBe("files.length", "2"); | 19 shouldBe("files.length", "2"); |
19 shouldBeTrue("files.item(0) instanceof File"); | 20 shouldBeTrue("files.item(0) instanceof File"); |
20 shouldBeEqualToString("files.item(0).name", "UTF8.txt"); | 21 shouldBeEqualToString("files.item(0).name", "UTF8.txt"); |
21 shouldBeTrue("files.item(1) instanceof File"); | 22 shouldBeTrue("files.item(1) instanceof File"); |
22 shouldBeEqualToString("files.item(1).name", "UTF8-2.txt"); | 23 shouldBeEqualToString("files.item(1).name", "UTF8-2.txt"); |
23 shouldBeNull("files.item(2)"); | 24 shouldBeNull("files.item(2)"); |
24 shouldBeNull("files.item(-1)"); | 25 shouldBeNull("files.item(-1)"); |
25 shouldBeTrue("files.item(0) === files.item(4294967296)"); | 26 shouldBeTrue("files.item(0) === files.item(4294967296)"); |
26 shouldBeTrue("files.item(1) === files.item(4294967297)"); | 27 shouldBeTrue("files.item(1) === files.item(4294967297)"); |
27 shouldBeTrue("files.item(2) === files.item(4294967298)"); | 28 shouldBeTrue("files.item(2) === files.item(4294967298)"); |
28 shouldBeTrue("files.item(-1) === files.item(4294967295)"); | 29 shouldBeTrue("files.item(-1) === files.item(4294967295)"); |
29 shouldBeTrue("files.item(-4294967295) === files.item(1)"); | 30 shouldBeTrue("files.item(-4294967295) === files.item(1)"); |
30 shouldBeTrue("files.item(-4294967296) === files.item(0)"); | 31 shouldBeTrue("files.item(-4294967296) === files.item(0)"); |
31 shouldBeTrue("files.item(null) === files.item(0)"); | 32 shouldBeTrue("files.item(null) === files.item(0)"); |
32 shouldBeTrue("files.item(undefined) === files.item(0)"); | 33 shouldBeTrue("files.item(undefined) === files.item(0)"); |
33 } | 34 } |
34 | 35 |
35 eventSender.beginDragWithFiles(["resources/UTF8.txt", "resources/UTF8-2.txt"]); | 36 eventSender.beginDragWithFiles(["resources/UTF8.txt", "resources/UTF8-2.txt"]); |
36 eventSender.mouseMoveTo(10, 10); | 37 eventSender.mouseMoveTo(10, 10); |
37 eventSender.mouseUp(); | 38 eventSender.mouseUp(); |
38 | 39 |
39 </script> | 40 </script> |
40 </body> | 41 </body> |
41 </html> | 42 </html> |
OLD | NEW |