Commit c4653a99 authored by Hector Carmona's avatar Hector Carmona Committed by Commit Bot

WebUI: Fix a11y test failures caused by paper-input 2.1.0

- Update a11y exceptions in edit_dictionary_a11y_test.js
- Delete unused copy of edit_dictionary_a11y_test.js

R=dpapad@chromium.org

Bug: 807475
Change-Id: Id3b166b1e253c90d697e3b6752d48fefa52e717e
Reviewed-on: https://chromium-review.googlesource.com/898488
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534171}
parent 3dc27da6
...@@ -33,12 +33,16 @@ AccessibilityTest.define('SettingsAccessibilityTest', { ...@@ -33,12 +33,16 @@ AccessibilityTest.define('SettingsAccessibilityTest', {
'aria-valid-attr-value': function(nodeResult) { 'aria-valid-attr-value': function(nodeResult) {
const describerId = const describerId =
nodeResult.element.getAttribute('aria-describedby'); nodeResult.element.getAttribute('aria-describedby');
return describerId === '' && nodeResult.element.id === 'input'; return describerId === '' && nodeResult.element.tagName == 'INPUT';
}, },
'button-name': function(nodeResult) { 'button-name': function(nodeResult) {
const node = nodeResult.element; const node = nodeResult.element;
return node.classList.contains('icon-expand-more'); return node.classList.contains('icon-expand-more');
}, },
'tabindex': function(nodeResult) {
// TODO(crbug.com/808276): remove this exception when bug is fixed.
return nodeResult.element.getAttribute('tabindex') == '0';
},
}) })
}); });
......
...@@ -41,10 +41,7 @@ AccessibilityTest.define('SettingsAccessibilityTest', { ...@@ -41,10 +41,7 @@ AccessibilityTest.define('SettingsAccessibilityTest', {
return node.classList.contains('icon-expand-more'); return node.classList.contains('icon-expand-more');
}, },
'tabindex': function(nodeResult) { 'tabindex': function(nodeResult) {
// TODO(hcarmona): investigate why we need this exception. // TODO(crbug.com/808276): remove this exception when bug is fixed.
// This fails when paper-input is updated, but tabindex is correct upon
// manual inspection. Filtering out the failure so we can continue Polymer
// migration.
return nodeResult.element.getAttribute('tabindex') == '0'; return nodeResult.element.getAttribute('tabindex') == '0';
}, },
}, },
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Define accessibility tests for the EDIT_DICTIONARY route.
*/
// Disable since the EDIT_DICTIONARY route does not exist on Mac.
GEN('#if !defined(OS_MACOSX)');
/** @const {string} Path to root from chrome/test/data/webui/settings/. */
const ROOT_PATH = '../../../../../';
// SettingsAccessibilityTest fixture.
GEN_INCLUDE([
ROOT_PATH + 'chrome/test/data/webui/settings/settings_accessiblity_test.js',
]);
AccessibilityTest.define('SettingsAccessibilityTest', {
/** @override */
name: 'EDIT_DICTIONARY',
/** @override */
axeOptions: SettingsAccessibilityTest.axeOptions,
/** @override */
setup: function() {
console.log('the route is not undefined!');
assert(settings.routes.EDIT_DICTIONARY != undefined);
settings.navigateTo(settings.routes.EDIT_DICTIONARY);
Polymer.dom.flush();
},
/** @override */
tests: {'Accessible with No Changes': function() {}},
/** @override */
violationFilter:
Object.assign({}, SettingsAccessibilityTest.violationFilter, {
// Excuse Polymer paper-input elements.
'aria-valid-attr-value': function(nodeResult) {
const describerId =
nodeResult.element.getAttribute('aria-describedby');
return describerId === '' && nodeResult.element.id === 'input';
},
'button-name': function(nodeResult) {
const node = nodeResult.element;
return node.classList.contains('icon-expand-more');
},
})
});
GEN('#endif // !defined(OS_MACOSX)');
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment