OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @fileoverview Library providing basic test framework functionality. | 6 * @fileoverview Library providing basic test framework functionality. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * Namespace for |Test|. | 10 * Namespace for |Test|. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 | 164 |
165 /** | 165 /** |
166 * Returns the configuration for the accessibility audit, creating it | 166 * Returns the configuration for the accessibility audit, creating it |
167 * on-demand. | 167 * on-demand. |
168 * @return {axs.AuditConfiguration} | 168 * @return {axs.AuditConfiguration} |
169 */ | 169 */ |
170 get accessibilityAuditConfig() { | 170 get accessibilityAuditConfig() { |
171 // The axs namespace is not available in chromevox tests. | 171 // The axs namespace is not available in chromevox tests. |
172 // Further, 'window' is not available in unit tests, but since the | 172 // Further, 'window' is not available in unit tests, but since the |
173 // accessibility audit library pulls in the closure library, | 173 // accessibility audit library pulls in the closure library, |
174 // 'goog.global' has to be present if axs is, so we use that here. | 174 // 'goog.global' has to be present if axs is, so we use that here. |
Peter Lundblad
2015/11/23 12:54:46
Please update this comment to reflect the change b
apacible
2015/11/24 18:03:46
Done.
| |
175 if (!this.accessibilityAuditConfig_ && | 175 if (!this.accessibilityAuditConfig_) { |
176 goog && goog.global && goog.global.axs) { | |
177 this.accessibilityAuditConfig_ = new axs.AuditConfiguration(); | 176 this.accessibilityAuditConfig_ = new axs.AuditConfiguration(); |
178 | 177 |
179 this.accessibilityAuditConfig_.showUnsupportedRulesWarning = false; | 178 this.accessibilityAuditConfig_.showUnsupportedRulesWarning = false; |
180 | 179 |
181 this.accessibilityAuditConfig_.auditRulesToIgnore = [ | 180 this.accessibilityAuditConfig_.auditRulesToIgnore = [ |
182 // The "elements with meaningful background image" accessibility | 181 // The "elements with meaningful background image" accessibility |
183 // audit (AX_IMAGE_01) does not apply, since Chrome doesn't | 182 // audit (AX_IMAGE_01) does not apply, since Chrome doesn't |
184 // disable background images in high-contrast mode like some | 183 // disable background images in high-contrast mode like some |
185 // browsers do. | 184 // browsers do. |
186 "elementsWithMeaningfulBackgroundImage", | 185 "elementsWithMeaningfulBackgroundImage", |
187 | 186 |
188 // Most WebUI pages are inside an IFrame, so the "web page should | 187 // Most WebUI pages are inside an IFrame, so the "web page should |
189 // have a title that describes topic or purpose" test (AX_TITLE_01) | 188 // have a title that describes topic or purpose" test (AX_TITLE_01) |
190 // generally does not apply. | 189 // generally does not apply. |
191 "pageWithoutTitle", | 190 "pageWithoutTitle", |
192 | 191 |
193 // TODO(aboxhall): re-enable when crbug.com/267035 is fixed. | 192 // TODO(aboxhall): re-enable when crbug.com/267035 is fixed. |
194 // Until then it's just noise. | 193 // Until then it's just noise. |
195 "lowContrastElements", | 194 "lowContrastElements", |
195 | |
196 // TODO(aboxhall): re-enable when following issue is fixed. | |
197 // github.com/GoogleChrome/accessibility-developer-tools/issues/251 | |
198 "tableHasAppropriateHeaders", | |
196 ]; | 199 ]; |
197 } | 200 } |
198 return this.accessibilityAuditConfig_; | 201 return this.accessibilityAuditConfig_; |
199 }, | 202 }, |
200 | 203 |
201 /** | 204 /** |
202 * Whether to treat accessibility issues (errors or warnings) as test | 205 * Whether to treat accessibility issues (errors or warnings) as test |
203 * failures. If true, any accessibility issues will cause the test to fail. | 206 * failures. If true, any accessibility issues will cause the test to fail. |
204 * If false, accessibility issues will cause a console.warn. | 207 * If false, accessibility issues will cause a console.warn. |
205 * Off by default to begin with; as we add the ability to suppress false | 208 * Off by default to begin with; as we add the ability to suppress false |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1829 exports.TEST = TEST; | 1832 exports.TEST = TEST; |
1830 exports.TEST_F = TEST_F; | 1833 exports.TEST_F = TEST_F; |
1831 exports.RUNTIME_TEST_F = TEST_F; | 1834 exports.RUNTIME_TEST_F = TEST_F; |
1832 exports.GEN = GEN; | 1835 exports.GEN = GEN; |
1833 exports.GEN_INCLUDE = GEN_INCLUDE; | 1836 exports.GEN_INCLUDE = GEN_INCLUDE; |
1834 exports.WhenTestDone = WhenTestDone; | 1837 exports.WhenTestDone = WhenTestDone; |
1835 | 1838 |
1836 // Import the Mock4JS helpers. | 1839 // Import the Mock4JS helpers. |
1837 Mock4JS.addMockSupport(exports); | 1840 Mock4JS.addMockSupport(exports); |
1838 })(this); | 1841 })(this); |
OLD | NEW |