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

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

Issue 2709473003: Add internals.textAffinity (Closed)
Patch Set: update Created 3 years, 10 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/Source/core/testing/Internals.h » ('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 007df4905460b19034e24a471e6963e35ca36aa4..5bebfd22a08dd349967606e769f2935f427af3c3 100644
--- a/third_party/WebKit/LayoutTests/editing/assert_selection.html
+++ b/third_party/WebKit/LayoutTests/editing/assert_selection.html
@@ -313,4 +313,25 @@ test(() => {
const sample4 = assert_selection('abc', '', 'abc', 'description');
assert_equals(sample4.iframe_.parentNode, null, 'with description');
}, 'removeSampleIfSucceeded');
+
+test(() => {
+ assert_exists(window, 'internals');
+ assert_exists(window, 'eventSender');
+ assert_selection(
+ 'foo|bar',
+ () => { assert_equals(internals.textAffinity, 'Downstream'); },
+ 'foo|bar');
+ assert_selection(
+ '<div contenteditable style="width: 25px;">foobar</div>',
+ selection => {
+ eventSender.dragMode = false;
+ var document = selection.document;
+ var div = document.querySelector('div');
+ eventSender.mouseMoveTo(document.offsetLeft + div.offsetLeft + 20,
+ document.offsetTop + div.offsetTop + 5);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ assert_equals(internals.textAffinity, 'Upstream'); },
+ '<div contenteditable style="width: 25px;">foo|bar</div>');
+}, 'Textaffinity');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698