blob: 7843b443743964e63b9041a3ae5ee080ed2c905a [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<pre id="console"></pre>
<script>
function log(s) {
document.getElementById("console").innerHTML += s + "\n";
}
</script>
<div contenteditable><span id="span">webkit</span></div>
<script>
var span = document.getElementById("span");
getSelection().setPosition(span, 0);
getSelection().modify("extend", "forward", "line");
if (window.testRunner)
testRunner.execCommand("MoveToEndOfLine");
shouldBe('getSelection().toString()', "''");
getSelection().empty();
getSelection().setPosition(span, 5);
getSelection().modify("extend", "backward", "line");
if (window.testRunner)
testRunner.execCommand("MoveToBeginningOfLine");
shouldBe('getSelection().toString()', "''");
</script>
</body>