Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / drag-downloadURL.html
blob1ec619672e8e1118b8ab9798273c9c996b818adb
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 #drag {
6 border: 1px solid black;
7 height: 200px;
8 width: 200px;
10 #drop {
11 border: 1px solid black;
12 height: 200px;
13 width: 200px;
15 </style>
16 <script>
17 function log(str)
19 var result = document.getElementById('result');
20 result.appendChild(document.createTextNode(str));
21 result.appendChild(document.createElement('br'));
23 function dragstart(event) {
24 event.dataTransfer.setData('DownloadURL', 'http://google.com/');
26 function dragenter(event) {
27 event.preventDefault();
29 function dragover(event) {
30 event.preventDefault();
32 function drop(event) {
33 var failed = false;
34 if (event.dataTransfer.types.indexOf('downloadurl') < 0) {
35 log('types: ' + event.dataTransfer.types);
36 failed = true;
38 if (event.dataTransfer.getData('DownloadURL') != 'http://google.com/') {
39 log('getData: ' + event.dataTransfer.getData('DownloadURL'));
40 failed = true;
42 log(failed ? 'FAILURE' : 'SUCCESS');
43 if (window.testRunner)
44 testRunner.notifyDone();
46 window.onload = function()
48 if (!window.testRunner)
49 return;
50 testRunner.dumpAsText();
51 testRunner.waitUntilDone();
53 var dragElement = document.getElementById('drag');
54 eventSender.mouseMoveTo(dragElement.offsetLeft + dragElement.offsetWidth / 2,
55 dragElement.offsetTop + dragElement.offsetHeight / 2);
56 eventSender.mouseDown();
57 eventSender.leapForward(100);
58 var dropElement = document.getElementById('drop');
59 eventSender.mouseMoveTo(dropElement.offsetLeft + dropElement.offsetWidth / 2,
60 dropElement.offsetTop + dropElement.offsetHeight / 2);
61 eventSender.mouseUp();
63 </script>
64 </head>
65 <body>
66 <p>To manually test, drag 'Drag Me' to 'Drop Here' and drop. The word 'SUCCESS' should appear.
67 <div draggable="true" id="drag" ondragstart="dragstart(event)">Drag Me</div>
68 <div id="drop" ondragenter="dragenter(event)" ondragover="dragover(event)" ondrop="drop(event)">Drop Here</div>
69 </div>
70 <div id="result"></div>
71 </body>
72 </html>