Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / drop-with-file-paths.html
blob3fb767570cb45b477f2bd2131b75b1fe18c09488
1 <html>
2 <body>
3 <script>
5 function runTest() {
6 if (!window.testRunner)
7 return;
9 window.testRunner.dumpAsText();
11 eventSender.beginDragWithFiles(['resources/file-for-drop-with-file-paths.html']);
12 eventSender.mouseMoveTo(10, 10);
13 eventSender.mouseUp();
16 document.body.addEventListener('dragenter',
17 function (e) {
18 e.preventDefault();
19 });
20 document.body.addEventListener('dragover',
21 function (e) {
22 e.preventDefault();
23 });
24 document.body.addEventListener('drop',
25 function (e) {
26 data = e.dataTransfer.getData('text/uri-list');
27 if (data) {
28 document.body.innerHTML += '<p>Dropped file: ' + data + '</p>';
29 document.body.innerHTML += 'Dropped types: ' + e.dataTransfer.types;
30 } else
31 document.body.innerHTML = 'PASS';
32 e.preventDefault();
33 });
35 window.onload = runTest;
36 </script>
37 <p>Drop files anywhere on this page. The page will try to intercept the drop--it should succeed but not be able to use dataTransfer.getData</p>
38 </body>
39 </html>