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

Unified Diff: third_party/WebKit/LayoutTests/editing/assert_selection.html

Issue 2963113002: Introduce Selection#compute{Left,Top} in assert_selection() (Closed)
Patch Set: 2017-06-29T15:20:58 Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/assert_selection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/assert_selection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698