Index: chrome/test/data/webui/test_api.js |
diff --git a/chrome/test/data/webui/test_api.js b/chrome/test/data/webui/test_api.js |
index 248929b7b12a3db8d7eab93336e763a0ab4fc5de..4c2243ed28bc47fe9da42cd09f92ef429214ac66 100644 |
--- a/chrome/test/data/webui/test_api.js |
+++ b/chrome/test/data/webui/test_api.js |
@@ -168,10 +168,15 @@ |
/** |
* Returns the configuration for the accessibility audit, creating it |
* on-demand. |
- * @return {!axs.AuditConfiguration} |
+ * @return {axs.AuditConfiguration} |
*/ |
get accessibilityAuditConfig() { |
- if (!this.accessibilityAuditConfig_) { |
+ // The axs namespace is not available in chromevox tests. |
+ // Further, 'window' is not available in unit tests, but since the |
+ // accessibility audit library pulls in the closure library, |
+ // 'goog.global' has to be present if axs is, so we use that here. |
+ if (!this.accessibilityAuditConfig_ && |
+ goog && goog.global && goog.global.axs) { |
this.accessibilityAuditConfig_ = new axs.AuditConfiguration(); |
this.accessibilityAuditConfig_.showUnsupportedRulesWarning = false; |
@@ -191,10 +196,6 @@ |
// TODO(aboxhall): re-enable when crbug.com/267035 is fixed. |
// Until then it's just noise. |
"lowContrastElements", |
- |
- // TODO(apacible): re-enable when following issue is fixed. |
- // github.com/GoogleChrome/accessibility-developer-tools/issues/251 |
- "tableHasAppropriateHeaders", |
]; |
} |
return this.accessibilityAuditConfig_; |
@@ -306,14 +307,17 @@ |
* @type {Function} |
*/ |
setUp: function() { |
- // These should be ignored in many of the web UI tests. |
- // user-image-stream and supervised-user-creation-image-stream are |
- // streaming video elements used for capturing a user image so they |
- // won't have captions and should be ignored everywhere. |
- this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', |
- '.user-image-stream'); |
- this.accessibilityAuditConfig.ignoreSelectors( |
- 'videoWithoutCaptions', '.supervised-user-creation-image-stream'); |
+ var auditConfig = this.accessibilityAuditConfig; |
+ if (auditConfig) { |
+ // These should be ignored in many of the web UI tests. |
+ // user-image-stream and supervised-user-creation-image-stream are |
+ // streaming video elements used for capturing a user image so they |
+ // won't have captions and should be ignored everywhere. |
+ auditConfig.ignoreSelectors('videoWithoutCaptions', |
+ '.user-image-stream'); |
+ auditConfig.ignoreSelectors( |
+ 'videoWithoutCaptions', '.supervised-user-creation-image-stream'); |
+ } |
}, |
/** |