<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id='top'>
</div>
<pre id="console"></pre>
<script>
description("Tests to ensure that dblclick event is not fired.");

function clickHandler(event)
{
    debug('click event is fired.');
}

function dblclickHandler(event)
{
    testFailed('dblclick event should not be fired.');
}

function test()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    var node = document.getElementById('top');
    node.addEventListener('click', clickHandler, false);
    node.addEventListener('dblclick', dblclickHandler, false);

    var event = document.createEvent("MouseEvents");
    var details = 2;
    event.initMouseEvent("click", true, false, window,
                         details, 10, 10, 10, 10, false, false, false, false, 0, null);
    node.dispatchEvent(event);
}

test();
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
