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 | 7 |
8 /** | 8 /** |
9 * Test fixture for cvox2.cursors. | 9 * Test fixture for cvox2.cursors. |
10 * @constructor | 10 * @constructor |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 [WORD, BACKWARD, | 254 [WORD, BACKWARD, |
255 {value: 'same line', index: 0}, {value: 'same line', index: 4}], | 255 {value: 'same line', index: 0}, {value: 'same line', index: 4}], |
256 | 256 |
257 [WORD, BACKWARD, | 257 [WORD, BACKWARD, |
258 {value: 'start ', index: 0}, {value: 'start ', index: 5}], | 258 {value: 'start ', index: 0}, {value: 'start ', index: 5}], |
259 [WORD, BACKWARD, | 259 [WORD, BACKWARD, |
260 {value: undefined, index: 0}, {value: undefined, index: 5}], | 260 {value: undefined, index: 0}, {value: undefined, index: 5}], |
261 ], this.RANGE); | 261 ], this.RANGE); |
262 }); | 262 }); |
263 | 263 |
264 | |
265 TEST_F('CursorsTest', 'LineRange', function() { | 264 TEST_F('CursorsTest', 'LineRange', function() { |
266 this.runCursorMovesOnDocument(this.simpleDoc, [ | 265 this.runCursorMovesOnDocument(this.simpleDoc, [ |
267 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], | 266 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], |
268 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], | 267 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], |
269 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], | 268 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], |
270 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], | 269 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], |
271 | 270 |
272 [LINE, BACKWARD, | 271 [LINE, BACKWARD, |
273 {value: 'start ', index: 0}, {value: 'same line', index: 9}], | 272 {value: 'start ', index: 0}, {value: 'same line', index: 9}], |
274 | 273 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 var para = root.firstChild; | 317 var para = root.firstChild; |
319 var webRange = new cursors.Range.fromNode(para); | 318 var webRange = new cursors.Range.fromNode(para); |
320 var auraRange = cursors.Range.fromNode(root.parent); | 319 var auraRange = cursors.Range.fromNode(root.parent); |
321 assertFalse(auraRange.isWebRange()); | 320 assertFalse(auraRange.isWebRange()); |
322 assertTrue(webRange.isWebRange()); | 321 assertTrue(webRange.isWebRange()); |
323 }); | 322 }); |
324 }); | 323 }); |
325 | 324 |
326 TEST_F('CursorsTest', 'SingleDocSelection', function() { | 325 TEST_F('CursorsTest', 'SingleDocSelection', function() { |
327 this.runWithLoadedTree(function() {/*! | 326 this.runWithLoadedTree(function() {/*! |
328 <p><a href="google.com">google home page</a></p> | 327 <span>start</span> |
| 328 <a href="google.com">google home page</a> |
329 <p>some more text</p> | 329 <p>some more text</p> |
330 <p>end of text</p> | 330 <p>end of text</p> |
331 */}, | 331 */}, |
332 function(root) { | 332 function(root) { |
333 var link = root.firstChild.firstChild; | 333 var link = root.firstChild.firstChild; |
334 var p1 = root.firstChild.nextSibling; | 334 var p1 = root.firstChild.nextSibling; |
335 var p2 = p1.nextSibling; | 335 var p2 = p1.nextSibling; |
336 | 336 |
337 var singleSel = new cursors.Range( | 337 var singleSel = new cursors.Range( |
338 new cursors.Cursor(link, 0), | 338 new cursors.Cursor(link, 0), |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 // Negative cases. | 450 // Negative cases. |
451 assertFalse(rootRange.contentEquals(regionRange)); | 451 assertFalse(rootRange.contentEquals(regionRange)); |
452 assertFalse(rootRange.contentEquals(staticTextRange)); | 452 assertFalse(rootRange.contentEquals(staticTextRange)); |
453 assertFalse(rootRange.contentEquals(inlineTextBoxRange)); | 453 assertFalse(rootRange.contentEquals(inlineTextBoxRange)); |
454 assertFalse(regionRange.contentEquals(rootRange)); | 454 assertFalse(regionRange.contentEquals(rootRange)); |
455 assertFalse(staticTextRange.contentEquals(rootRange)); | 455 assertFalse(staticTextRange.contentEquals(rootRange)); |
456 assertFalse(inlineTextBoxRange.contentEquals(rootRange)); | 456 assertFalse(inlineTextBoxRange.contentEquals(rootRange)); |
457 }); | 457 }); |
458 }); | 458 }); |
OLD | NEW |