<html> 
<head>

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

<script>
if (window.testRunner) {
    testRunner.dumpAsText();
	testRunner.waitUntilDone();
}

var type1 = 'application/json';
var type2 = 'text/plain';

document.addEventListener('copy', function (evt){
    if (evt.clipboardData) {
        evt.clipboardData.setData(type1, 'Foo');
        evt.clipboardData.setData(type2, 'Bar');
        evt.preventDefault();
    }
});

document.addEventListener('paste', function (evt) {
    if (evt.clipboardData) {
        evt.preventDefault();
		document.getElementById('output').innerText = evt.clipboardData.getData(type1) + evt.clipboardData.getData(type2);
    }

	if (window.testRunner)
		testRunner.notifyDone();
});

function loaded()
{
	document.getElementById('input').select();
	copyCommand();
	pasteCommand();
}

</script>
</head> 
<body onload="loaded();">
Copy then paste.  The output should read "FooBar"<br><br>
Data to copy: <input id="input" value='Hello World'><br>
Data pasted:<div id="output"></div>
</body>
</html>
