chromium/third_party/blink/web_tests/editing/selection/line-wrap-1.html

<script>
if (window.testRunner) {
    testRunner.dumpEditingCallbacks();
    testRunner.dumpAsLayoutWithPixelResults();
}
</script>
<p>Only 'bar' should be selected.</p>

<div id="test" style="width: 50px; border: 1px solid black;">foo bar baz foo</div>

<script>
var s = window.getSelection();
var e = document.getElementById("test");

s.setBaseAndExtent(e.firstChild, 4, e.firstChild, 7);
</script>