<html>
<head>
<script src=../../editing.js></script>
<script src="../../../resources/js-test-pre.js"></script>
<script>

function editingTest() {
    edit = document.getElementById('edit');
    edit.focus();
    typeCharacterCommand('h');
    typeCharacterCommand('a');
    if (window.internals)
        internals.handleAcceptedCandidate("happy ", 0, 2);

    if (window.testRunner)
        testRunner.dumpAsText(true);
}

</script>
</head>
<body>
<p>This test verifies that accepted candidates replace the text before the caret.</p>
<div style="border:1px solid black;">
    <div contenteditable="true" id="edit"></div>
</div>

<div style="visibility:hidden;">
    <br>
</div>

<div style="width: 1px; height: 1px;"></div>

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