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
11 document.body.appendChild(document.createElement('br'));
12 document.body.appendChild(document.createElement('div').appendChild(document.createTextNode(text)));
14 window.addEventListener('beforeunload', function ()
17 layoutTestController.notifyDone();
19 document.body.addEventListener('dragenter', function (event)
21 event.preventDefault();
23 document.body.addEventListener('dragover', function (event)
25 event.preventDefault();
27 document.body.addEventListener('drop', function (event)
29 log('Not preventing default event on drop.');
33 if (!window.layoutTestController)
35 layoutTestController.dumpAsText();
36 layoutTestController.waitUntilDone();
38 eventSender.beginDragWithFiles(['DRTFakeFile']);
39 eventSender.mouseMoveTo(document.body.offsetLeft + 10, document.body.offsetTop + 10);
40 eventSender.mouseUp();
41 window.setTimeout(function ()
43 // Deadman's switch so we don't need to wait for the test to timeout to fail.
45 layoutTestController.notifyDone();