Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/mouse/double_click_after_last_cell.html

Issue 2178193004: Convert editing/selection/5057506.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-26T18:38:20 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698