1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
3 <script src="../js/resources/js-test-pre.js"></script>
5 #dropTarget { text-align: center; display: table-cell; vertical-align: middle }
6 #dropTarget {width: 256px; height: 256px; border: 1px dashed}
14 window.onload = function()
16 dropTarget = document.getElementById("dropTarget");
17 dropEffectElem = document.getElementById("dropEffect");
18 consoleElm = document.getElementById("console");
20 if (!dropTarget || !dropEffectElem || !consoleElm)
23 dropEffectElem.onclick = changeDropZone;
25 dropTarget.ondrop = drop;
30 function changeDropZone()
32 dropTarget.setAttribute("webkitdropzone", dropEffectElem.options[dropEffectElem.selectedIndex].value + " file:text/html");
35 function printDropEvent(e)
37 chosenDropEffect = dropEffectElem.options[dropEffectElem.selectedIndex].value;
38 debug("Received drop event when chosenDropEffect is " + chosenDropEffect);
43 if (!window.eventSender)
46 if (window.testRunner)
47 testRunner.dumpAsText();
49 var endX = dropTarget.offsetLeft + 10;
50 var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2
52 var numEffects = dropEffectElem.options.length;
54 for (var j = 0; j < numEffects; ++j) {
55 dropEffectElem.options[j].selected = true;
58 eventSender.beginDragWithFiles(["resources/file-for-prevent-drag-to-navigate.html"]);
59 eventSender.mouseMoveTo(endX, endY);
60 eventSender.mouseUp();
63 var testContainer = document.getElementById("test-container");
65 document.body.removeChild(testContainer);
66 debug('<br /><span class="pass">TEST COMPLETE</span>');
69 <script src="resources/dropzone.js"></script>
72 <p id="description"></p>
73 <div id="test-container">
74 <div id="dropTarget">Drop the file onto me.<br/><br/>
75 <label for="dropEffect">Expects dropEffect</label> <select id="dropEffect">
76 <option value="copy">Copy</option>
77 <option value="move">Move</option>
78 <option value="link">Link</option>
79 <option value="dummy">Nonexistent (Dummy) Effect should be converted to copy</option>
85 <div id="console"></div>
87 description("This test checks that drag-and-drop support works with files.<br/>");