EWS should have a way to retry a patch
[WebKit-https.git] / LayoutTests / fast / events / dropzone-004.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <head>
3 <script src="../../resources/js-test-pre.js"></script>
4 <style>
5 #dropTarget { text-align: center; display: table-cell; vertical-align: middle }
6 #dropTarget {width: 256px; height: 256px; border: 1px dashed}
7 </style>
8 <script>
9 var dropTarget;
10 var dropEffectElem;
11 var consoleElm;
12 var event;
13
14 window.onload = function()
15 {
16     dropTarget = document.getElementById("dropTarget");
17     dropEffectElem = document.getElementById("dropEffect");
18     consoleElm = document.getElementById("console");
19     
20     if (!dropTarget || !dropEffectElem || !consoleElm)
21         return;
22     
23     dropEffectElem.onclick = changeDropZone;
24     changeDropZone();
25     dropTarget.ondrop = drop;
26     
27     runTest();
28 }
29
30 function changeDropZone()
31 {
32     dropTarget.setAttribute("webkitdropzone", dropEffectElem.options[dropEffectElem.selectedIndex].value + " file:text/html");
33 }
34
35 function printDropEvent(e)
36 {
37     chosenDropEffect = dropEffectElem.options[dropEffectElem.selectedIndex].value;
38     debug("Received drop event when chosenDropEffect is " + chosenDropEffect);
39 }
40
41 function runTest()
42 {
43     if (!window.eventSender)
44         return;
45         
46     if (window.testRunner)
47         testRunner.dumpAsText();
48         
49     var endX = dropTarget.offsetLeft + 10;
50     var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2
51     
52     var numEffects = dropEffectElem.options.length;
53     
54     for (var j = 0; j < numEffects; ++j) {
55         dropEffectElem.options[j].selected = true;
56         changeDropZone();
57             
58         eventSender.beginDragWithFiles(["resources/file-for-prevent-drag-to-navigate.html"]);
59         eventSender.mouseMoveTo(endX, endY);
60         eventSender.mouseUp();
61     }
62
63     var testContainer = document.getElementById("test-container");
64     if (testContainer)
65         document.body.removeChild(testContainer);
66     debug('<br /><span class="pass">TEST COMPLETE</span>');
67 }
68 </script>
69 <script src="resources/dropzone.js"></script>
70 </head>
71 <body>
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>
80 </select>
81 </div>
82 <hr/>
83 <hr/>
84 </div>
85 <div id="console"></div>
86 <script>
87 description("This test checks that drag-and-drop support works with files.<br/>");
88 </script>
89 </body>
90 </html>