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

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

Issue 2121413002: Support selection and copying over non-editable content in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. 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
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 b2d30fc0798bf92404a8b500f91c62aab3ddbb64..cd09156418bb3b4475637d896d2933db3f5f9509 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs
@@ -369,9 +369,23 @@ TEST_F('CursorsTest', 'MultiLineOffsetSelection', function() {
assertEquals('diff ', secondLine.name);
var secondLineCursor = new cursors.Cursor(secondLine, -1);
- assertEquals(0, secondLineCursor.selectionIndex_);
- secondLineCursor = new cursors.Cursor(secondLine, 0);
- secondLineCursor.index = 0;
+ // The selected node moves to the static text node.
+ assertEquals(secondLineCursor.node.parent,
+ secondLineCursor.selectionNode_);
+ // This selects the entire node via a character offset.
assertEquals(6, secondLineCursor.selectionIndex_);
+
+ // Index into the characters.
+ secondLineCursor = new cursors.Cursor(secondLine, 1);
+ assertEquals(7, secondLineCursor.selectionIndex_);
+
+ // Now, try selecting via node offsets.
+ var cursor = new cursors.Cursor(root.firstChild, -1);
+ assertEquals(root, cursor.selectionNode_);
+ assertEquals(0, cursor.selectionIndex_);
+
+ cursor = new cursors.Cursor(root.firstChild.nextSibling, -1);
+ assertEquals(root, cursor.selectionNode_);
+ assertEquals(1, cursor.selectionIndex_);
});
});

Powered by Google App Engine
This is Rietveld 408576698