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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 assertEquals('diff ', cursor.node.firstChild.nextSibling.name); | 291 assertEquals('diff ', cursor.node.firstChild.nextSibling.name); |
292 assertEquals('line', cursor.node.lastChild.name); | 292 assertEquals('line', cursor.node.lastChild.name); |
293 }); | 293 }); |
294 }); | 294 }); |
295 | 295 |
296 TEST_F('CursorsTest', 'WrappingCursors', function() { | 296 TEST_F('CursorsTest', 'WrappingCursors', function() { |
297 this.runWithLoadedTree(this.multiInlineDoc, function(root) { | 297 this.runWithLoadedTree(this.multiInlineDoc, function(root) { |
298 var para = root.firstChild; | 298 var para = root.firstChild; |
299 var cursor = new cursors.WrappingCursor(para, -1); | 299 var cursor = new cursors.WrappingCursor(para, -1); |
300 cursor = cursor.move(DOM_NODE, DIRECTIONAL, BACKWARD); | 300 cursor = cursor.move(DOM_NODE, DIRECTIONAL, BACKWARD); |
301 assertEquals(root.lastChild.firstChild, cursor.node); | 301 assertEquals(root.lastChild.firstChild.firstChild, cursor.node); |
302 cursor = cursor.move(DOM_NODE, DIRECTIONAL, FORWARD); | 302 cursor = cursor.move(DOM_NODE, DIRECTIONAL, FORWARD); |
303 assertEquals(root.firstChild.firstChild, cursor.node); | 303 assertEquals(root.firstChild.firstChild, cursor.node); |
304 }); | 304 }); |
305 }); | 305 }); |
306 | 306 |
307 TEST_F('CursorsTest', 'IsInWebRange', function() { | 307 TEST_F('CursorsTest', 'IsInWebRange', function() { |
308 this.runWithLoadedTree(this.simpleDoc, function(root) { | 308 this.runWithLoadedTree(this.simpleDoc, function(root) { |
309 var para = root.firstChild; | 309 var para = root.firstChild; |
310 var webRange = new cursors.Range.fromNode(para); | 310 var webRange = new cursors.Range.fromNode(para); |
311 var auraRange = cursors.Range.fromNode(root.parent); | 311 var auraRange = cursors.Range.fromNode(root.parent); |
312 assertFalse(auraRange.isWebRange()); | 312 assertFalse(auraRange.isWebRange()); |
313 assertTrue(webRange.isWebRange()); | 313 assertTrue(webRange.isWebRange()); |
314 }); | 314 }); |
315 }); | 315 }); |
OLD | NEW |