Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/assert_selection.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.html b/third_party/WebKit/LayoutTests/editing/assert_selection.html |
| index 17a95e1f350faf849bcb41eb07eb4e793c2daefd..6287da33b231a6c8d5aa4d139045d4c618371920 100644 |
| --- a/third_party/WebKit/LayoutTests/editing/assert_selection.html |
| +++ b/third_party/WebKit/LayoutTests/editing/assert_selection.html |
| @@ -345,4 +345,27 @@ test(() => { |
| assert_equals(internals.textAffinity, 'Upstream'); }, |
| '<div contenteditable style="width: 25px;">foo|bar</div>'); |
| }, 'Textaffinity'); |
| + |
| +test(() => { |
| + assert_exists(window, 'eventSender'); |
| + assert_selection( |
| + [ |
| + '<div id="first">one <span id="start"></span>two three</div>', |
| + '<div id="second">four <span id="end"></span>five six</div>', |
| + ].join(''), |
| + selection => { |
| + const start = document.getElementById('start'); |
| + const end = document.getElementById('end'); |
| + eventSender.mouseMoveTo(selection.computeLeft(start), |
| + selection.computeTop(start)); |
| + eventSender.mouseDown(); |
| + eventSender.mouseMoveTo(selection.computeLeft(end), |
| + selection.computeTop(end)); |
| + eventSender.mouseUp(); |
| + }, |
| + [ |
| + '<div id="first">one <span id="start"></span>two three</div>', |
|
yoichio
2017/06/29 08:09:35
We miss cursors in expect.
yosin_UTC9
2017/06/29 09:06:19
Oops, I forgot to update.
|
| + '<div id="second">four <span id="end"></span>five six</div>', |
| + ].join('')); |
| +}, 'computeLeft() and computeTop()'); |
| </script> |