Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/selection/mouse/double_click_after_last_cell.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/selection/mouse/double_click_after_last_cell.html b/third_party/WebKit/LayoutTests/editing/selection/mouse/double_click_after_last_cell.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bbc68e07fc393afffd3b7aa05dd8dc26ede147eb |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/selection/mouse/double_click_after_last_cell.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<p> |
| +This tests double clicking after the last character in the last cell of a |
| +block table. The paragraph break (the space between the last character and the |
| +first character in the next paragraph) should be selected. Selection painting |
| +problems might prevent the paragraph break from appearing as selected even |
| +though it is. To test manually, double click inside the table cell, after the |
| +last character, and hit delete. Afterward, the table should contain 'foobar'. |
| +</p> |
| +<div contenteditable="true"> |
| +<table border="1"><tr><td width="100px"><span id="span">foo</span></td></tr></table> |
| +<div id="end">bar</div> |
| +</div> |
| +<script> |
| +test(() => { |
| + assert_not_equals(window.eventSender, undefined, |
| + 'this test requires eventSender'); |
| + |
| + const span = document.getElementById('span'); |
| + const x = span.offsetParent.offsetLeft + span.offsetLeft + span.offsetWidth + 10; |
| + y = span.offsetParent.offsetParent.offsetTop + span.offsetParent.offsetTop + span.offsetTop + span.offsetHeight / 2; |
|
Xiaocheng
2016/07/27 02:43:15
nit: const
|
| + |
| + eventSender.mouseMoveTo(x, y); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + |
| + const selection = window.getSelection(); |
| + assert_false(selection.isCollapsed, 'isCollapsed'); |
| + assert_equals(selection.anchorNode, span.firstChild, 'anchorNode'); |
| + assert_equals(selection.anchorOffset, 3, 'anchorOffset'); |
| + assert_equals(selection.focusNode, document.getElementById('end'), 'focusNode'); |
| + assert_equals(selection.focusOffset, 0, 'focusOffset'); |
| +}); |
| +</script> |