Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Unified Diff: chrome/test/data/webui/test_api.js

Issue 11664011: Add a mechanism to ignore certain elements for accessibility audit on a per-test basis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Dominic's comments; revert accidental changes to third_party/accessibility-developer-tools Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 04e7d4df84511d6a30979238387e7b35bd9baa5b..724b7634ada21905b525d3eeec61845889a131c9 100644
--- a/chrome/test/data/webui/test_api.js
+++ b/chrome/test/data/webui/test_api.js
@@ -888,7 +888,7 @@ var testing = {};
* @private
*/
function runAccessibilityAudit(a11yErrors, a11yWarnings) {
- var auditResults = axs.Audit.run();
+ var auditResults = axs.Audit.run(this.auditConfig);
for (var i = 0; i < auditResults.length; i++) {
var auditResult = auditResults[i];
if (auditResult.result == axs.constants.AuditResult.FAIL) {
@@ -975,11 +975,13 @@ var testing = {};
/**
* Asserts that the current page state passes the accessibility audit.
+ * @param {Array=} opt_errors Array to fill with errors, if desired.
+ * @param {Array=} opt_warnings Array to fill with warnings, if desired.
*/
- function assertAccessibilityOk() {
+ function assertAccessibilityOk(opt_errors, opt_warnings) {
helper.registerCall();
- var a11yErrors = [];
- var a11yWarnings = [];
+ var a11yErrors = opt_errors || [];
+ var a11yWarnings = opt_warnings || [];
if (!runAccessibilityAudit(a11yErrors, a11yWarnings))
throw new Error(accessibilityAuditReport(a11yErrors, a11yWarnings));
}

Powered by Google App Engine
This is Rietveld 408576698