<body onload="test()">
<p>This test checks that the context menu is shown over a simple non-editable text.</p>
<div id="text">Lorem ipsum</div>
<div id="result">FAIL</div>
</body>
<script>
function test()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    var text = document.getElementById("text");

    var x = text.offsetParent.offsetLeft + text.offsetLeft + 4;
    var y = text.offsetParent.offsetTop + text.offsetTop + text.offsetHeight / 2;

    if (!window.eventSender)
        return;

    eventSender.mouseMoveTo(x, y);

    var items = eventSender.contextClick();

    if (items.length > 0)
        document.getElementById('result').innerHTML = 'SUCCESS';
    else
        document.getElementById('result').innerHTML = 'FAILURE: No context menu';
}
</script>
