test_bug1187157.html (838B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1187157 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1187157</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1187157">Mozilla Bug 1187157</a> 14 <form id="a"><input name="b" type="file"/></form> 15 16 <script type="text/javascript"> 17 var obj = new FormData(document.getElementById('a')).get('b'); 18 ok(obj instanceof File, "This should return a File"); 19 is(obj.size, 0, "Size should be 0"); 20 is(obj.name, "", "Name should be the empty string."); 21 is( 22 obj.type, 23 "application/octet-stream", 24 "Type should be application/octet-stream" 25 ); 26 27 </script> 28 29 </body> 30 </html>