chromium/third_party/blink/web_tests/editing/selection/mouse/mouse-selection-sideways-lr.html

<!DOCTYPE html>
<script src="../../../resources/ahem.js"></script>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../resources/mouse-selection.js"></script>
<style>
html {
  writing-mode: sideways-lr;
  font: 20px/20px Ahem;
  word-wrap: break-word;
}
body {
  margin: 0;
}
div {
  height: 200px;
  margin: 200px;
}
</style>
<!-- 40 Xs, 4 lines -->
<div id="div">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div>
<script>
// The expectations are based on windows editing behavior.
if (window.internals)
  internals.settings.setEditingBehavior('win');

var node = div.firstChild;
const LEFT_EDGE = 200;
const RIGHT_EDGE = 600;
const TOP_EDGE = 200;
const BOTTOM_EDGE = 400;
testMouseSelection(LEFT_EDGE + 10, TOP_EDGE + 90, LEFT_EDGE + 70, TOP_EDGE + 90,
                   node, 5, node, 35,
                   'Middle of the first line -> Middle of the last line');
testMouseSelection(LEFT_EDGE + 10, TOP_EDGE + 90, LEFT_EDGE + 50, BOTTOM_EDGE + 100,
                   node, 5, node, 20,
                   'Middle of the first line -> Outside below the third line');
testMouseSelection(LEFT_EDGE + 10, TOP_EDGE + 90, LEFT_EDGE + 50, TOP_EDGE - 100,
                   node, 5, node, 30,
                   'Middel of the first line -> Outside above the third line');
testMouseSelection(LEFT_EDGE + 10, TOP_EDGE + 90, RIGHT_EDGE, TOP_EDGE + 90,
                   node, 5, node, 35,
                   'Middle of the first line -> Outside right, vertical middle');
testMouseSelection(LEFT_EDGE + 10, TOP_EDGE + 90, RIGHT_EDGE, TOP_EDGE - 100,
                   node, 5, node, 40,
                   'Middle of the first line -> Outside right, above');
testMouseSelection(LEFT_EDGE + 70, TOP_EDGE + 90, LEFT_EDGE - 100, TOP_EDGE + 90,
                   node, 5, node, 35,
                   'Middle of the last line -> Outside left, vertical middle');
testMouseSelection(LEFT_EDGE + 70, TOP_EDGE + 90, LEFT_EDGE + 30, TOP_EDGE - 100,
                   node, 20, node, 35,
                   'Middle of the last line -> Outside above the second line');
testMouseSelection(LEFT_EDGE + 70, TOP_EDGE + 90, LEFT_EDGE + 30, BOTTOM_EDGE + 100,
                   node, 10, node, 35,
                   'Middle of the last line -> Outside below the second line');
</script>