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 createBox(name) { | 7 function createBox(name) { |
8 var div = document.createElement('div'); | 8 var div = document.createElement('div'); |
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('dragover', function(e) { | 12 div.addEventListener('dragover', function(e) { |
13 e.preventDefault(); | 13 e.preventDefault(); |
14 }); | 14 }); |
15 div.addEventListener('drop', function(e) { | 15 div.addEventListener('drop', function(e) { |
16 debug('PASS: drop event is fired.'); | 16 debug('PASS: drop event is fired.'); |
| 17 e.preventDefault(); |
17 }); | 18 }); |
18 | 19 |
19 return div; | 20 return div; |
20 } | 21 } |
21 | 22 |
22 function runTest() { | 23 function runTest() { |
23 var shadowRoot = host.createShadowRoot(); | 24 var shadowRoot = host.createShadowRoot(); |
24 var shadowDiv = createBox('shadow'); | 25 var shadowDiv = createBox('shadow'); |
25 shadowRoot.appendChild(shadowDiv); | 26 shadowRoot.appendChild(shadowDiv); |
26 | 27 |
27 eventSender.beginDragWithFiles(["../resources/apple.gif"]); | 28 eventSender.beginDragWithFiles(["../resources/apple.gif"]); |
28 mouseMoveToElem(shadowDiv); | 29 mouseMoveToElem(shadowDiv); |
29 eventSender.mouseUp(); | 30 eventSender.mouseUp(); |
30 } | 31 } |
31 </script> | 32 </script> |
32 </head> | 33 </head> |
33 <body onload="runTest()"> | 34 <body onload="runTest()"> |
34 | 35 |
35 <div id="host"></div> | 36 <div id="host"></div> |
36 <pre id="console"></pre> | 37 <pre id="console"></pre> |
37 </body> | 38 </body> |
38 </html> | 39 </html> |
OLD | NEW |