chromium/third_party/blink/web_tests/editing/selection/previous-line-position.html

<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// There was a workaround added to fix rdar://problem/4033202. A bug to remove
// the workaround was filed as rdar://problem/4040763. The underlying problem
// with VisiblePositions was fixed, and so I removed the workaround and added
// this layout test.
const kStyle = [
    'margin-top: 0px;',
    'margin-right: 0px;',
    'margin-bottom: 0px;',
    'margin-left: 0px;',
    'min-height: 14px;'
].join(' ');

selection_test(
    [
        '<div contenteditable>',
            `<p style="${kStyle}">|hi<span></span></p><br>test`,
        '</div>',
    ],
    selection => selection.modify('move', 'forward', 'line'),
    [
        '<div contenteditable>',
            `<p style="${kStyle}">hi<span></span></p>|<br>test`,
        '</div>',
    ]);
</script>