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 (e
)
17 testRunner
.notifyDone();
20 document
.body
.addEventListener('dragenter', function (event
)
22 event
.preventDefault();
24 document
.body
.addEventListener('dragover', function (event
)
26 event
.preventDefault();
28 document
.body
.addEventListener('drop', function (event
)
30 log('Not preventing default event on drop.');
34 if (!window
.testRunner
)
36 testRunner
.dumpAsText();
37 testRunner
.waitUntilDone();
39 eventSender
.beginDragWithFiles(['DRTFakeFile']);
40 eventSender
.mouseMoveTo(document
.body
.offsetLeft
+ 10, document
.body
.offsetTop
+ 10);
41 eventSender
.mouseUp();
42 window
.setTimeout(function ()
44 // Deadman's switch so we don't need to wait for the test to timeout to fail.
45 testRunner
.notifyDone();