blob: 002798dc789026b705dba184b92f64be6030be34 [file] [log] [blame]
<script>
if (window.layoutTestController)
layoutTestController.dumpEditingCallbacks();
</script>
<script>
function log(str) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
var console = document.getElementById("console");
console.appendChild(li);
}
function shouldBe(expected, actual) {
if (expected != actual)
log("Failure. Expected: " + expected + ", Actual: " + actual);
else
log("Passed");
}
</script>
<p>This tests Copy/Paste of a input field.</p>
<div id="div" contenteditable="true"><input type="text"></div>
<ul id="console"></ul>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("SelectAll");
document.execCommand("Copy");
var sel = window.getSelection();
sel.modify("move", "forward", "character");
document.execCommand("Paste");
shouldBe(document.getElementsByTagName("input").length, 2);
</script>