| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, 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 |
| 307 TEST_F('CursorsTest', 'IsInWebRange', function() { |
| 308 this.runWithLoadedTree(this.simpleDoc, function(root) { |
| 309 var para = root.firstChild; |
| 310 var webRange = new cursors.Range.fromNode(para); |
| 311 var auraRange = cursors.Range.fromNode(root.parent); |
| 312 assertFalse(auraRange.isWebRange()); |
| 313 assertTrue(webRange.isWebRange()); |
| 314 }); |
| 315 }); |
| OLD | NEW |