diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html')
-rw-r--r-- | testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html b/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html new file mode 100644 index 000000000..2efaa059f --- /dev/null +++ b/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset='utf-8'> + <title>FileAPI Test: filelist_multiple_selected_files</title> + <link rel='author' title='Intel' href='http://www.intel.com'> + <link rel='help' href='http://dev.w3.org/2006/webapi/FileAPI/#filelist-section'> + <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-length"> + <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-item"> + <script src='/resources/testharness.js'></script> + <script src='/resources/testharnessreport.js'></script> + </head> + + <body> + <form name='uploadData'> + <input type='file' id='fileChooser' multiple> + </form> + <div> + <p>Test steps:</p> + <ol> + <li>Download <a href='support/upload.txt'>upload.txt</a>, <a href="support/upload.zip">upload.zip</a> to local.</li> + <li>Select the local two files (upload.txt, upload.zip) to run the test.</li> + </ol> + </div> + + <div id='log'></div> + + <script> + var fileInput = document.querySelector('#fileChooser'); + var fileList; + + setup({explicit_done: true, explicit_timeout: true}); + + on_event(fileInput, 'change', function(evt) { + test(function() { + fileList = document.querySelector('#fileChooser').files; + assert_equals(fileList.length, 2, 'fileList length is 2'); + }, 'Check if the fileList length is 2 when selected two files'); + + test(function() { + fileList = document.querySelector('#fileChooser').files; + assert_true(fileList.item(0) instanceof File, 'item method is instanceof File'); + }, 'Check if the item method returns the File interface when selected two files'); + + test(function() { + fileList = document.querySelector('#fileChooser').files; + assert_not_equals(fileList.item(1), null, 'item(1) is not null'); + }, 'Check if item(1) is not null when selected two files. Index must be treated by user agents as value for the position of a File object in the FileList, with 0 representing the first file.'); + + test(function() { + fileList = document.querySelector('#fileChooser').files; + assert_equals(fileList.item(2), null, 'item(2) is null'); + }, 'Check if item(2) is null when selected two files'); + + test(function() { + fileList = document.querySelector('#fileChooser').files; + assert_array_equals([fileList.item(0).name, fileList.item(1).name], ['upload.txt', 'upload.zip'], 'file name string is the name of selected files "upload.txt", "upload.zip"'); + }, 'Check if the file name string is the name of selected files'); + + done(); + }); + </script> + </body> +</html> |