OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 div, span { | 5 div, span { |
6 border: 1px solid black; | 6 border: 1px solid black; |
7 }; | 7 }; |
8 </style> | 8 </style> |
9 <script> | 9 <script> |
10 var dropReceived; | 10 var dropReceived; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 e.preventDefault(); | 47 e.preventDefault(); |
48 dropReceived = true; | 48 dropReceived = true; |
49 log('Drop received in drop target 2'); | 49 log('Drop received in drop target 2'); |
50 }, false); | 50 }, false); |
51 | 51 |
52 if (!window.testRunner) | 52 if (!window.testRunner) |
53 return; | 53 return; |
54 testRunner.dumpAsText(); | 54 testRunner.dumpAsText(); |
55 testRunner.waitUntilDone(); | 55 testRunner.waitUntilDone(); |
56 | 56 |
57 window.addEventListener('beforeunload', function () { | 57 window.addEventListener('beforeunload', function (e) { |
58 if (!dropReceived) | 58 if (!dropReceived) |
59 log('Drop not received'); | 59 log('Drop not received'); |
| 60 e.preventDefault(); |
60 testRunner.notifyDone(); | 61 testRunner.notifyDone(); |
61 }); | 62 }); |
62 | 63 |
63 dragDrop(drop1); | 64 dragDrop(drop1); |
64 unloadExpected = true; | 65 unloadExpected = true; |
65 dragDrop(drop2); | 66 dragDrop(drop2); |
66 window.setTimeout(function () { | 67 window.setTimeout(function () { |
67 // Deadman's switch to fail quickly. | 68 // Deadman's switch to fail quickly. |
68 log('FAIL: navigation expected'); | 69 log('FAIL: navigation expected'); |
69 testRunner.notifyDone(); | 70 testRunner.notifyDone(); |
70 }, 0); | 71 }, 0); |
71 } | 72 } |
72 </script> | 73 </script> |
73 </head> | 74 </head> |
74 <body> | 75 <body> |
75 <p>To run this test manually, drag a file to one of the two boxes below. | 76 <p>To run this test manually, drag a file to one of the two boxes below. |
76 <div id="drop1">Dropping in drop target 1 should result in a drop event.</div> | 77 <div id="drop1">Dropping in drop target 1 should result in a drop event.</div> |
77 <div id="drop2">Dropping in drop target 2 should NOT result in a drop event (pag
e will navigate).</div> | 78 <div id="drop2">Dropping in drop target 2 should NOT result in a drop event (pag
e will navigate).</div> |
78 <div id="result"> | 79 <div id="result"> |
79 </div> | 80 </div> |
80 </body> | 81 </body> |
81 </html> | 82 </html> |
OLD | NEW |