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 7be43bcde21e079efbd40914ce79e0811f62149e..9433676e61f101700ef7c7ec38ab4b75b5693aad 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs |
@@ -407,6 +407,40 @@ TEST_F('EditingTest', 'RichTextMoveByCharacterEndOfLine', function() { |
}); |
}); |
+TEST_F('EditingTest', 'RichTextExtendByCharacter', function() { |
+ var mockFeedback = this.createMockFeedback(); |
+ this.runWithLoadedTree(function() {/*! |
+ <div id="go" role="textbox" contenteditable>Te<br>st</div> |
+ |
+ <script> |
+ document.getElementById('go').addEventListener('click', function() { |
+ var sel = getSelection(); |
+ sel.modify('extend', 'forward', 'character'); |
+ }, true); |
+ </script> |
+ */}, function(root) { |
+ var input = root.find({role: RoleType.TEXT_FIELD}); |
+ var moveByChar = input.doDefault.bind(input); |
+ |
+ this.listenOnce(input, 'focus', function() { |
+ mockFeedback.call(moveByChar) |
+ .expectSpeech('T', 'selected') |
+ .call(moveByChar) |
+ .expectSpeech('e', 'added to selection') |
+ .call(moveByChar) |
+ .expectSpeech('selected') |
+ .call(moveByChar) |
+ // This gets described by the line logic in EditableLine. |
+ .expectSpeech('s', 'selected') |
+ .call(moveByChar) |
+ .expectSpeech('t', 'added to selection') |
+ |
+ .replay(); |
+ }); |
+ input.focus(); |
+ }); |
+}); |
+ |
TEST_F('EditingTest', 'EditableLineOneStaticText', function() { |
this.runWithLoadedTree(function() {/*! |
<p contenteditable style="word-spacing:100000px">this is a test</p> |