| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Include test fixture. | 5 // Include test fixture. |
| 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', | 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', |
| 7 '../../testing/assert_additions.js']); | 7 '../../testing/assert_additions.js']); |
| 8 | 8 |
| 9 GEN_INCLUDE(['../../testing/mock_feedback.js']); | 9 GEN_INCLUDE(['../../testing/mock_feedback.js']); |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 .expectSpeech('foxtraut', 'Heading 2') | 155 .expectSpeech('foxtraut', 'Heading 2') |
| 156 .expectBraille('foxtraut h2'); | 156 .expectBraille('foxtraut h2'); |
| 157 mockFeedback.call(doCmd('nextObject')) | 157 mockFeedback.call(doCmd('nextObject')) |
| 158 .expectSpeech('end') | 158 .expectSpeech('end') |
| 159 .expectBraille('end'); | 159 .expectBraille('end'); |
| 160 mockFeedback.call(doCmd('previousObject')) | 160 mockFeedback.call(doCmd('previousObject')) |
| 161 .expectSpeech('foxtraut', 'Heading 2') | 161 .expectSpeech('foxtraut', 'Heading 2') |
| 162 .expectBraille('foxtraut h2'); | 162 .expectBraille('foxtraut h2'); |
| 163 mockFeedback.call(doCmd('nextLine')) | 163 mockFeedback.call(doCmd('nextLine')) |
| 164 .expectSpeech('end', 'of test') | 164 .expectSpeech('end', 'of test') |
| 165 .expectBraille('end of test'); | 165 .expectBraille('endof test'); |
| 166 | 166 |
| 167 mockFeedback.call(doCmd('jumpToTop')) | 167 mockFeedback.call(doCmd('jumpToTop')) |
| 168 .expectSpeech('start') | 168 .expectSpeech('start') |
| 169 .expectBraille('start'); | 169 .expectBraille('start'); |
| 170 mockFeedback.call(doCmd('jumpToBottom')) | 170 mockFeedback.call(doCmd('jumpToBottom')) |
| 171 .expectSpeech('of test') | 171 .expectSpeech('of test') |
| 172 .expectBraille('of test'); | 172 .expectBraille('of test'); |
| 173 | 173 |
| 174 mockFeedback.replay(); | 174 mockFeedback.replay(); |
| 175 }); | 175 }); |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 <input type="text"></input> | 1199 <input type="text"></input> |
| 1200 */}, function(root) { | 1200 */}, function(root) { |
| 1201 this.listenOnce(root, 'focus', function(e) { | 1201 this.listenOnce(root, 'focus', function(e) { |
| 1202 var focus = ChromeVoxState.instance.currentRange.start.node; | 1202 var focus = ChromeVoxState.instance.currentRange.start.node; |
| 1203 assertEquals(RoleType.textField, focus.role); | 1203 assertEquals(RoleType.textField, focus.role); |
| 1204 assertTrue(focus.state.focused); | 1204 assertTrue(focus.state.focused); |
| 1205 }); | 1205 }); |
| 1206 doCmd('nextEditText')(); | 1206 doCmd('nextEditText')(); |
| 1207 }); | 1207 }); |
| 1208 }); | 1208 }); |
| 1209 |
| 1210 TEST_F('BackgroundTest', 'BrailleCaretNavigation', function() { |
| 1211 var mockFeedback = this.createMockFeedback(); |
| 1212 this.runWithLoadedTree(function(root) {/*! |
| 1213 <p>This is a<em>test</em> of inline braille<br>with a second line</p> |
| 1214 */}, function(root) { |
| 1215 var text = 'This is a'; |
| 1216 mockFeedback.call(doCmd('nextCharacter')) |
| 1217 .expectBraille(text, {startIndex: 1, endIndex: 2}) // h |
| 1218 .call(doCmd('nextCharacter')) |
| 1219 .expectBraille(text, {startIndex: 2, endIndex: 3}) // i |
| 1220 .call(doCmd('nextWord')) |
| 1221 .expectBraille(text, {startIndex: 5, endIndex: 7}) // is |
| 1222 .call(doCmd('previousWord')) |
| 1223 .expectBraille(text, {startIndex: 0, endIndex: 4}) // This |
| 1224 .call(doCmd('nextLine')) |
| 1225 // Ensure nothing is selected when the range covers the entire line. |
| 1226 .expectBraille('with a second line', {startIndex: -1, endIndex: -1}) |
| 1227 .replay(); |
| 1228 }); |
| 1229 }); |
| OLD | NEW |