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
3 // found in the LICENSE file.
5 // Include test fixture.
6 GEN_INCLUDE(['walker_unittest_base.js']);
11 * @extends {CvoxWalkerTestBase}
13 function CvoxGroupWalkerUnitTest() {}
15 CvoxGroupWalkerUnitTest.prototype = {
16 __proto__: CvoxWalkerUnitTestBase.prototype,
19 closureModuleDeps: CvoxWalkerUnitTestBase.prototype.closureModuleDeps.concat(
23 newWalker: function() {
24 return new cvox.GroupWalker();
28 * Set up for simple html tests.
31 setUpSimpleHtml_: function() {
32 this.loadDoc(function() {/*!
46 CvoxWalkerUnitTestBase.addCommonTests('CvoxGroupWalkerUnitTest');
48 TEST_F('CvoxGroupWalkerUnitTest', 'testSimpleForwardSync', function() {
49 this.setUpSimpleHtml_();
52 var sel = cvox.CursorSelection.fromNode($('asdf'));
53 var ret = this.go(sel, 'sync', {selNodeId: 'a', selReversed: false});
56 var ret2 = this.walker.sync(ret);
57 assertTrue(ret2.equals(ret));
60 TEST_F('CvoxGroupWalkerUnitTest', 'testSimpleReversedSync', function() {
61 this.setUpSimpleHtml_();
64 var sel = cvox.CursorSelection.fromNode($('asdf'));
65 sel.setReversed(true);
66 var ret = this.go(sel, 'sync', {selNodeId: 'c', selReversed: true});
69 var ret2 = this.walker.sync(ret);
70 assertTrue(ret2.equals(ret));
73 TEST_F('CvoxGroupWalkerUnitTest', 'testSimpleForwardNext', function() {
74 this.setUpSimpleHtml_();
77 var sel = cvox.CursorSelection.fromNode($('asdf'));
78 sel = this.walker.sync(sel);
79 var ret = this.go(sel, 'next', {selNodeId: 'b', selReversed: false});
82 TEST_F('CvoxGroupWalkerUnitTest', 'testSimpleReversedNext', function() {
83 this.setUpSimpleHtml_();
86 var sel = cvox.CursorSelection.fromNode($('asdf'));
87 sel = this.walker.sync(sel.setReversed(true));
88 var ret = this.go(sel, 'next', {selNodeId: 'b', selReversed: true});