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

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-30T17:20:04 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..1c8d75737d93fd3ba4a4dceac946a7836e662384 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 = selection.document.getElementById('start');
+ const end = selection.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>',
+ '<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