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_unittest_base.js']); | 6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); |
7 | 7 |
8 /** | 8 /** |
9 * Test fixture for aria_util.js. | 9 * Test fixture for aria_util.js. |
10 * @constructor | 10 * @constructor |
11 * @extends {ChromeVoxUnitTestBase} | 11 * @extends {ChromeVoxUnitTestBase} |
12 */ | 12 */ |
13 function CvoxAriaUtilUnitTest() {} | 13 function CvoxAriaUtilUnitTest() {} |
14 | 14 |
15 CvoxAriaUtilUnitTest.prototype = { | 15 CvoxAriaUtilUnitTest.prototype = { |
16 __proto__: ChromeVoxUnitTestBase.prototype, | 16 __proto__: ChromeVoxUnitTestBase.prototype, |
17 | 17 |
18 /** @override */ | 18 /** @override */ |
19 extraLibraries: [ | 19 closureModuleDeps: [ |
20 'aria_util.js', | 20 'cvox.AriaUtil', |
21 'dom_util.js', | 21 'cvox.ChromeVox', |
22 'node_state.js', | 22 'cvox.DomUtil',] |
23 'chromevox.js', | |
24 '../host/interface/abstract_earcons.js'] | |
25 }; | 23 }; |
26 | 24 |
27 TEST_F('CvoxAriaUtilUnitTest', 'GetStateGridWithActiveCell', function() { | 25 TEST_F('CvoxAriaUtilUnitTest', 'GetStateGridWithActiveCell', function() { |
28 this.loadDoc(function() {/*! | 26 this.loadDoc(function() {/*! |
29 <div id="grid" role="grid" aria-activedescendant="cell"> | 27 <div id="grid" role="grid" aria-activedescendant="cell"> |
30 <div role="row"> | 28 <div role="row"> |
31 <div id="cell" role="gridcell"> | 29 <div id="cell" role="gridcell"> |
32 </div> | 30 </div> |
33 </div> | 31 </div> |
34 */}); | 32 */}); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 var outerLiveRegions = cvox.AriaUtil.getLiveRegions(outer); | 133 var outerLiveRegions = cvox.AriaUtil.getLiveRegions(outer); |
136 assertEquals(2, outerLiveRegions.length); | 134 assertEquals(2, outerLiveRegions.length); |
137 assertNotEquals(-1, outerLiveRegions.indexOf(progress)); | 135 assertNotEquals(-1, outerLiveRegions.indexOf(progress)); |
138 assertNotEquals(-1, outerLiveRegions.indexOf(progress2)); | 136 assertNotEquals(-1, outerLiveRegions.indexOf(progress2)); |
139 | 137 |
140 // getLiveRegions works walking up the tree as well. | 138 // getLiveRegions works walking up the tree as well. |
141 var ptextLiveRegions = cvox.AriaUtil.getLiveRegions(ptext); | 139 var ptextLiveRegions = cvox.AriaUtil.getLiveRegions(ptext); |
142 assertEquals(1, ptextLiveRegions.length); | 140 assertEquals(1, ptextLiveRegions.length); |
143 assertNotEquals(-1, ptextLiveRegions.indexOf(progress)); | 141 assertNotEquals(-1, ptextLiveRegions.indexOf(progress)); |
144 }); | 142 }); |
OLD | NEW |