[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / drop-handler-should-not-stop-navigate.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div>This tests that a drop handler's default action must be prevented in order to stop navigation.
5 Otherwise, if event.preventDefault() is not called, navigation should occur. To test manually,
6 simply drag and drop another link or HTML file on this page. If navigation occurs, then the test
7 passed.</div>
8 <script>
9 function log(text)
10 {
11     document.body.appendChild(document.createElement('br'));
12     document.body.appendChild(document.createElement('div').appendChild(document.createTextNode(text)));
13 }
14 window.addEventListener('beforeunload', function ()
15 {
16     log('PASS');
17     layoutTestController.notifyDone();
18 });
19 document.body.addEventListener('dragenter', function (event)
20 {
21     event.preventDefault();
22 });
23 document.body.addEventListener('dragover', function (event)
24 {
25     event.preventDefault();
26 });
27 document.body.addEventListener('drop', function (event)
28 {
29     log('Not preventing default event on drop.');
30 });
31 (function ()
32 {
33     if (!window.layoutTestController)
34         return;
35     layoutTestController.dumpAsText();
36     layoutTestController.waitUntilDone();
37     log('Starting test');
38     eventSender.beginDragWithFiles(['DRTFakeFile']);
39     eventSender.mouseMoveTo(document.body.offsetLeft + 10, document.body.offsetTop + 10);
40     eventSender.mouseUp();
41     window.setTimeout(function ()
42     {
43         // Deadman's switch so we don't need to wait for the test to timeout to fail.
44         log('FAIL');
45         layoutTestController.notifyDone();
46     }, 0);
47 })();
48 </script>
49 </body>
50 </html>