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

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

Issue 2966973002: Reland: Expand EditableLine to include non-inline text box leafs (Closed)
Patch Set: Created 3 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/editing_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
index 6bfb586ce35c6eb8a0fd9e5eaad91991af31c3b6..f589443a408f1386dc5bf1902da2b11b386f597f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
@@ -484,6 +484,62 @@ TEST_F('EditingTest', 'RichTextExtendByCharacter', function() {
});
});
+TEST_F('EditingTest', 'RichTextImageByCharacter', function() {
+ var mockFeedback = this.createMockFeedback();
+ this.runWithLoadedTree(function() {/*!
+ <p id="go" contenteditable>
+ <img alt="dog"></img> is a <img alt="cat"</img> test
+ </p>
+ <script>
+ document.getElementById('go').addEventListener('click', function() {
+ var sel = getSelection();
+ sel.modify('move', 'forward', 'character');
+ }, true);
+ </script>
+ */}, function(root) {
+ var input = root.find({role: RoleType.PARAGRAPH});
+ var moveByChar = input.doDefault.bind(input);
+
+ this.listenOnce(input, 'focus', function() {
+ var lineText = 'dog is a cat test';
+ mockFeedback.call(moveByChar)
+ // Note that this isn't quite correct. This should be the second
+ // character which is a space ' '.
+ .expectSpeech('dog', 'Image')
+ // Ditto.
+ .expectBraille(lineText, {startIndex: 0, endIndex: 0})
+ .call(moveByChar)
+ .expectSpeech('i')
+ .expectBraille(lineText, {startIndex: 4, endIndex: 4})
+ .call(moveByChar)
+ .expectSpeech('s')
+ .expectBraille(lineText, {startIndex: 5, endIndex: 5})
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, {startIndex: 6, endIndex: 6})
+ .call(moveByChar)
+ .expectSpeech('a')
+ .expectBraille(lineText, {startIndex: 7, endIndex: 7})
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, {startIndex: 8, endIndex: 8})
+ .call(moveByChar)
+
+ // This is technically wrong because we're actually over the entire
+ // image. This is broken because of bad node offsets.
+ .expectSpeech('c')
+ .expectBraille(lineText, {startIndex: 9, endIndex: 9})
+
+ // Unfortunately, the node offset being wrong here means there's no
+ // output for the next character move. Fix Once node offsets get fixed
+ // in Blink.
+
+ .replay();
+ });
+ input.focus();
+ });
+});
+
TEST_F('EditingTest', 'EditableLineOneStaticText', function() {
this.runWithLoadedTree(function() {/*!
<p contenteditable style="word-spacing:100000px">this is a test</p>

Powered by Google App Engine
This is Rietveld 408576698