| 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();
|
| + });
|
| +});
|
|
|