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/html/editing/dnd/platform/file-to-system.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/html/editing/dnd/platform/file-to-system.html')
-rw-r--r-- | testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html b/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html new file mode 100644 index 000000000..af9840e8c --- /dev/null +++ b/testing/web-platform/tests/html/editing/dnd/platform/file-to-system.html @@ -0,0 +1,50 @@ +<!doctype html> +<html> + <head> + <title>Dragging a file to the system</title> + <style type="text/css"> +span { display: inline-block; height: 100px; width: 100px; background: orange; } + </style> + <script type="text/javascript"> +window.onload = function () { + var drag = document.getElementsByTagName('span')[0]; + drag.ondragstart = function (e) { + e.dataTransfer.setData('text','PASS'); + e.dataTransfer.effectAllowed = 'copy'; + var filein = document.getElementsByTagName('input')[0]; + if( !filein.files ) { + document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file API is not supported.'; + return; + } + if( !filein.files[0] ) { + document.getElementsByTagName('p')[0].innerHTML = 'FAIL - no file was found in the file input.'; + return; + } + var thefile = filein.files[0]; + try { + e.dataTransfer.items.add(thefile); + } catch(err) { + document.getElementsByTagName('p')[0].innerHTML = 'FAIL - error when adding file'; + e.preventDefault(); + return; + } + if( e.dataTransfer.files.length != 1 ) { + document.getElementsByTagName('p')[0].innerHTML = 'FAIL - file was not attached to data store'; + e.preventDefault(); + } + }; +}; + </script> + </head> + <body> + <div>This test only applies to platforms where dropping a file onto a folder in the system's file manager copies/moves the file to that folder.</div> + <ol> + <li>Open an empty folder in your system's file manager.</li> + <li>Select a non-empty file on your computer using the following input: <input type="file"></li> + <li>Drag the orange square onto the folder in your system's file manager, and release it:<br><span draggable="true"></span></li> + <li>Pass if the file is copied to the folder.</li> + </ol> + <p></p> + <noscript><p>Enable JavaScript and reload</p></noscript> + </body> +</html>
\ No newline at end of file |