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 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); | 5 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); |
6 | 6 |
7 /** | 7 /** |
8 * Base class for walker test fixtures. | 8 * Base class for walker test fixtures. |
9 * @constructor | 9 * @constructor |
10 * @extends {ChromeVoxUnitTestBase} | 10 * @extends {ChromeVoxUnitTestBase} |
11 */ | 11 */ |
12 function CvoxWalkerUnitTestBase() {} | 12 function CvoxWalkerUnitTestBase() {} |
13 | 13 |
14 CvoxWalkerUnitTestBase.prototype = { | 14 CvoxWalkerUnitTestBase.prototype = { |
15 __proto__: ChromeVoxUnitTestBase.prototype, | 15 __proto__: ChromeVoxUnitTestBase.prototype, |
16 | 16 |
17 /** @override */ | 17 /** @override */ |
18 closureModuleDeps: [ | 18 closureModuleDeps: [ |
19 'cvox.CursorSelection', | 19 'TestMsgs', |
20 'cvox.TestMsgs' | 20 'cvox.CursorSelection' |
21 ], | 21 ], |
22 | 22 |
23 /** | 23 /** |
24 * Common set up for all walker test cases. | 24 * Common set up for all walker test cases. |
25 */ | 25 */ |
26 setUp: function() { | 26 setUp: function() { |
27 // Needed for getDescription and getGranularityMsg. | 27 // Needed for getDescription and getGranularityMsg. |
28 cvox.ChromeVox.msgs = new cvox.TestMsgs(); | 28 Msgs = TestMsgs; |
29 | 29 |
30 // Delete all nodes in the body. | 30 // Delete all nodes in the body. |
31 while (document.body.hasChildNodes()) { | 31 while (document.body.hasChildNodes()) { |
32 document.body.removeChild(document.body.lastChild); | 32 document.body.removeChild(document.body.lastChild); |
33 } | 33 } |
34 | 34 |
35 this.walker = this.newWalker(); | 35 this.walker = this.newWalker(); |
36 }, | 36 }, |
37 | 37 |
38 /** | 38 /** |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 */ | 225 */ |
226 TEST_F(testFixture, 'testEmptyBody', function() { | 226 TEST_F(testFixture, 'testEmptyBody', function() { |
227 var sel = cvox.CursorSelection.fromBody(); | 227 var sel = cvox.CursorSelection.fromBody(); |
228 | 228 |
229 // Testing for infinite loop. If one exists, this test will fail by timing | 229 // Testing for infinite loop. If one exists, this test will fail by timing |
230 // out. | 230 // out. |
231 var sync = this.walker.sync(sel); | 231 var sync = this.walker.sync(sel); |
232 var next = this.walker.next(sel); | 232 var next = this.walker.next(sel); |
233 }); | 233 }); |
234 }; | 234 }; |
OLD | NEW |