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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs

Issue 2153213002: Better work around for Blink selection issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle line breaks. 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
index cd09156418bb3b4475637d896d2933db3f5f9509..12279c0f7dd823cf4a873f5609599781d66c1538 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
@@ -34,6 +34,7 @@ CursorsTest.prototype = {
window.DOM_NODE = cursors.Unit.DOM_NODE;
window.BOUND = cursors.Movement.BOUND;
window.DIRECTIONAL = cursors.Movement.DIRECTIONAL;
+ window.RoleType = chrome.automation.RoleType;
},
/**
@@ -389,3 +390,36 @@ TEST_F('CursorsTest', 'MultiLineOffsetSelection', function() {
assertEquals(1, cursor.selectionIndex_);
});
});
+
+TEST_F('CursorsTest', 'InlineElementOffset', function() {
+ this.runWithLoadedTree(function() {/*!
+ <p>This<br> is a<a href="#g">test</a>of selection</p>
+ */}, function(root) {
+ root.addEventListener('textSelectionChanged', this.newCallback(function(evt) {
+ // This is a little unexpected though not really incorrect; Ctrl+C works.
+ assertEquals(testNode, root.anchorObject);
+ assertEquals(ofSelectionNode, root.focusObject);
+ assertEquals(4, root.anchorOffset);
+ assertEquals(1, root.focusOffset);
+ }));
+
+ // This is the link's static text.
+ var testNode = root.lastChild.lastChild.previousSibling.firstChild;
+ assertEquals(RoleType.staticText, testNode.role);
+ assertEquals('test', testNode.name);
+
+ var ofSelectionNode = root.lastChild.lastChild;
+ var cur = new cursors.Cursor(ofSelectionNode, 0);
+ assertEquals('of selection', cur.selectionNode_.name);
+ assertEquals(RoleType.staticText, cur.selectionNode_.role);
+ assertEquals(13, cur.selectionIndex_);
+
+ var curIntoO = new cursors.Cursor(ofSelectionNode, 1);
+ assertEquals('of selection', curIntoO.selectionNode_.name);
+ assertEquals(RoleType.staticText, curIntoO.selectionNode_.role);
+ assertEquals(14, curIntoO.selectionIndex_);
+
+ var oRange = new cursors.Range(cur, curIntoO);
+ oRange.select();
+ });
+});
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698