Commit bed50ef0 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in editing/selection/caret-ltr-right.html

This patch changes "caret-ltr-right.html" to utilize |selection_test()| for
ease of maintenance and enabling EditingNG.

Bug: 679977, 707656
Change-Id: Ie030551e9656436a4c2ac02cc14127b98d294e17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2262693
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782235}
parent 8708ed59
<!DOCTYPE html> <!DOCTYPE html>
<html> <script src="../../resources/testharness.js"></script>
<body> <script src="../../resources/testharnessreport.js"></script>
<p> <script src="../assert_selection.js"></script>
This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a LTR block.
To test manually, click the right of the text. The caret should be on the right edge.
</p>
<div style="font-size: 20px; width: 20ex; border: solid thin black; padding: 10px;" contenteditable>WebKit2</div>
<script src="resources/caret-edge-shared.js"></script>
<script> <script>
// This tests that clicking in a contenteditable div will set the caret in the
// right position for LTR text in a LTR block.
//
// To test manually, click the right of the text. The caret should be on the
// right edge.
const kStyle = [
'border: solid thin black;',
'font-size: 20px;',
'padding: 10px;',
'width: 20ex;',
].join('');
var clickOn = 'right'; selection_test(
var expectedOffset = 7; `<div contenteditable id="target" style="${kStyle}">XYZ</div>`,
selection => {
runTest(); const target = selection.document.getElementById('target');
if (!window.eventSender)
throw 'This test requires eventSender.';
eventSender.leapForward(9999); // reset mouse click state
eventSender.mouseMoveTo(
selection.computeLeft(target) + target.offsetWidth - 5,
selection.computeTop(target) + target.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
},
`<div contenteditable id="target" style="${kStyle}">XYZ|</div>`,
'Click the right of text.');
</script> </script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment