<html>
<script src="../editing.js"></script>
<script>

function mycopy(event)
{
    event.clipboardData.setData('text/plain', "SUCCESS");
    event.preventDefault();
}

function mypaste(event)
{
    var clip = event.clipboardData.getData('text/plain');
    document.getElementById('result').innerHTML = clip;
    event.preventDefault();
}

function test()
{
    execCopyCommand();
    var e = document.getElementById('result');
    setSelectionCommand(e, 0, e, 0);
    execPasteCommand();
    
    if (window.testRunner)
        testRunner.dumpAsText();
}

</script>
<body onload='test()' onbeforecopy='event.preventDefault()' oncopy='mycopy(event)' onbeforepaste='event.preventDefault()' onpaste='mypaste(event)'>

<div id='result' contenteditable='true'>FAILURE</div>

</body>
</html>
