OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/event-sender-util.js"></script> | 4 <script src="../resources/event-sender-util.js"></script> |
5 <script src="../../../resources/js-test.js"></script> | 5 <script src="../../../resources/js-test.js"></script> |
6 <script> | 6 <script> |
7 function createInput(name) { | 7 function createInput(name) { |
8 var div = document.createElement('input'); | 8 var div = document.createElement('input'); |
9 div.style.width = '100px'; | 9 div.style.width = '100px'; |
10 div.style.height = '100px'; | 10 div.style.height = '100px'; |
11 | 11 |
12 div.addEventListener('drop', function(e) { | 12 div.addEventListener('drop', function(e) { |
13 debug('PASS: drop event is fired.'); | 13 debug('PASS: drop event is fired.'); |
| 14 e.preventDefault(); |
14 }); | 15 }); |
15 | 16 |
16 return div; | 17 return div; |
17 } | 18 } |
18 | 19 |
19 function runTest() { | 20 function runTest() { |
20 var shadowRoot = host.createShadowRoot(); | 21 var shadowRoot = host.createShadowRoot(); |
21 var shadowInput = createInput('shadow'); | 22 var shadowInput = createInput('shadow'); |
22 shadowRoot.appendChild(shadowInput); | 23 shadowRoot.appendChild(shadowInput); |
23 | 24 |
24 eventSender.beginDragWithFiles(["../resources/apple.gif"]); | 25 eventSender.beginDragWithFiles(["../resources/apple.gif"]); |
25 mouseMoveToElem(shadowInput); | 26 mouseMoveToElem(shadowInput); |
26 eventSender.mouseUp(); | 27 eventSender.mouseUp(); |
27 } | 28 } |
28 </script> | 29 </script> |
29 </head> | 30 </head> |
30 <body onload="runTest()"> | 31 <body onload="runTest()"> |
31 | 32 |
32 <div id="host"></div> | 33 <div id="host"></div> |
33 <pre id="console"></pre> | 34 <pre id="console"></pre> |
34 </body> | 35 </body> |
35 </html> | 36 </html> |
OLD | NEW |