capture_fallback_file_upload-manual.html (1719B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset='utf-8'> 5 <title>HTML Media Capture Test: capture_fallback_file_upload</title> 6 <link rel='author' title='Intel' href='http://www.intel.com'> 7 <link rel='help' href='https://w3c.github.io/html-media-capture'> 8 <link rel='help' href='https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)'> 9 <meta name='flags' content='interact'> 10 <script src='/resources/testharness.js'></script> 11 <script src='/resources/testharnessreport.js'></script> 12 </head> 13 <body> 14 <p>This test validates that the user agent must act as if there was no capture attribute, when the accept attribute value is set to a MIME type that has no associated capture control type.</p> 15 16 <p>Test steps:</p> 17 <ol> 18 <li>Download <a href='support/upload.txt'>upload.txt</a> to local.</li> 19 <li>Select the local upload.txt file to run the test.</li> 20 </ol> 21 22 <form> 23 <input id='fileChooser' type='file' accept='text/plain' capture> 24 </form> 25 26 <div id='log'></div> 27 28 <script> 29 setup({explicit_done: true, explicit_timeout: true}); 30 31 var fileInput = document.querySelector('#fileChooser'); 32 33 on_event(fileInput, 'change', function(evt) { 34 test(function() { 35 var fileList = document.querySelector('#fileChooser').files; 36 assert_equals(fileList.length, 1, 'fileList length is 1'); 37 assert_equals(fileList.item(0).name, 'upload.txt', 'file name string is "upload.txt"'); 38 }, 'Check if input.capture fallback to file upload when the accept attribute value is set to a MIME type that has no associated capture control type'); 39 40 done(); 41 }); 42 </script> 43 </body> 44 </html>