OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 can test</div></div> | 204 can test</div></div> |
205 */}, | 205 */}, |
206 [ | 206 [ |
207 {start: 0, end: 4, text: 'this'}, | 207 {start: 0, end: 4, text: 'this'}, |
208 {start: 5, end: 5, text: ''}, | 208 {start: 5, end: 5, text: ''}, |
209 {start: 6, end: 6, text: ''}, | 209 {start: 6, end: 6, text: ''}, |
210 {start: 7, end: 8, text: 'I'}, | 210 {start: 7, end: 8, text: 'I'}, |
211 {start: 9, end: 17, text: 'can test'}, | 211 {start: 9, end: 17, text: 'can test'}, |
212 ]); | 212 ]); |
213 }); | 213 }); |
| 214 |
| 215 TEST_F('EditingTest', 'RichTextMoveByLine', function() { |
| 216 editing.useRichText = true; |
| 217 var mockFeedback = this.createMockFeedback(); |
| 218 this.runWithLoadedTree(function() {/*! |
| 219 <div id="go" role="textbox" contenteditable> |
| 220 <h2>hello</h2> |
| 221 <div><br></div> |
| 222 <p>This is a <a href="#test">test</a> of rich text</p> |
| 223 </div> |
| 224 <script> |
| 225 var dir = 'forward'; |
| 226 var line = 0; |
| 227 document.getElementById('go').addEventListener('click', function() { |
| 228 var sel = getSelection(); |
| 229 sel.modify('move', dir, 'line'); |
| 230 if (dir == 'forward') |
| 231 line++; |
| 232 else |
| 233 line--; |
| 234 |
| 235 if (line == 0) |
| 236 dir = 'forward'; |
| 237 if (line == 2) |
| 238 dir = 'backward'; |
| 239 }, true); |
| 240 </script> |
| 241 */}, function(root) { |
| 242 var input = root.find({role: RoleType.TEXT_FIELD}); |
| 243 var moveByLine = input.doDefault.bind(input); |
| 244 mockFeedback.call(input.focus.bind(input)) |
| 245 .call(moveByLine) |
| 246 .expectSpeech('blank') |
| 247 .expectBraille('') |
| 248 .call(moveByLine) |
| 249 .expectSpeech('This is a ', 'test', 'Link', ' of rich text') |
| 250 .expectBraille('This is a test lnk of rich text') |
| 251 .call(moveByLine) |
| 252 .expectSpeech('blank') |
| 253 .expectBraille('') |
| 254 .call(moveByLine) |
| 255 .expectSpeech('hello', 'Heading 2') |
| 256 .expectBraille('hello h2') |
| 257 .replay(); |
| 258 }); |
| 259 }); |
OLD | NEW |