| 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 db1e3106833bcf20e9f7e1b407fb8bbaeff30b07..3048084660bfd4ee290b8be9a215e4731f472c33 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
|
| @@ -375,3 +375,44 @@ TEST_F('CursorsTest', 'MultiLineOffsetSelection', function() {
|
| assertEquals(6, secondLineCursor.selectionIndex_);
|
| });
|
| });
|
| +
|
| +TEST_F('CursorsTest', 'ExhaustSelection', function() {
|
| + this.runWithLoadedTree(function() {/*!
|
| + <p style="max-width: 100px">
|
| + A new version of the ChromeVox screen
|
| + reader on Chrome OS, currently known as “ChromeVox Next,” is
|
| + available for beta testing.
|
| + </p>
|
| + */},
|
| + function(root) {
|
| + var node = root.firstChild.firstChild;
|
| + var range = new cursors.Range(
|
| + new cursors.Cursor(node, 0),
|
| + new cursors.Cursor(node, node.name.length));
|
| + var length = range.end.selectionIndex_;
|
| + var rev = function(start, end) {
|
| + if (start == end && end == (length - 1))
|
| + return;
|
| +
|
| + if (start == length - 1) {
|
| + start = 0;
|
| + end++;
|
| + }else {
|
| + start++;
|
| + }
|
| +
|
| + this.listenOnce(root, 'textSelectionChanged', function() {
|
| + console.log('Received selection: '+root.anchorOffset + ' ' + root.focusOffset);
|
| + rev(start, end);
|
| + }, true);
|
| +
|
| + range.start.index_ = start;
|
| + range.end.index_ = end;
|
| +
|
| + console.log('Waiting for textSelectionChanged on: ' + start + ' ' + end);
|
| + range.select();
|
| + }.bind(this);
|
| +
|
| + rev(-1, 0);
|
| + });
|
| +});
|
|
|