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

Side by Side Diff: chrome/browser/ui/webui/options/options_browsertest.js

Issue 1447693002: [a11y] Bring accessibility-audit up to date: v2.10.0 release. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per dbeam@'s comment. Created 5 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 unified diff | Download patch
OLDNEW
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 GEN_INCLUDE(['options_browsertest_base.js']); 5 GEN_INCLUDE(['options_browsertest_base.js']);
6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"');
7 7
8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users';
9 9
10 /** 10 /**
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 'clearPref', 72 'clearPref',
73 'coreOptionsUserMetricsAction', 73 'coreOptionsUserMetricsAction',
74 ]); 74 ]);
75 75
76 // Register stubs for methods expected to be called before/during tests. 76 // Register stubs for methods expected to be called before/during tests.
77 // Specific expectations can be made in the tests themselves. 77 // Specific expectations can be made in the tests themselves.
78 this.mockHandler.stubs().fetchPrefs(ANYTHING); 78 this.mockHandler.stubs().fetchPrefs(ANYTHING);
79 this.mockHandler.stubs().observePrefs(ANYTHING); 79 this.mockHandler.stubs().observePrefs(ANYTHING);
80 this.mockHandler.stubs().coreOptionsUserMetricsAction(ANYTHING); 80 this.mockHandler.stubs().coreOptionsUserMetricsAction(ANYTHING);
81 }, 81 },
82
83 /** @override */
84 setUp: function() {
85 OptionsBrowsertestBase.prototype.setUp.call(this);
86
87 // Enable when failure is resolved.
88 // AX_ARIA_10: http://crbug.com/559329
89 this.accessibilityAuditConfig.ignoreSelectors(
90 'unsupportedAriaAttribute',
91 '#profiles-list');
92
93 var linkWithUnclearPurposeSelectors = [
94 '#sync-overview > A',
95 '#privacy-explanation > A',
96 '#languages-section > .settings-row > A',
97 '#cloudprint-options-mdns > .settings-row > A',
98 '#do-not-track-confirm-overlay > .action-area > .hbox.stretch > A',
99 ];
100
101 // Enable when failure is resolved.
102 // AX_TEXT_04: http://crbug.com/559318
103 this.accessibilityAuditConfig.ignoreSelectors(
104 'linkWithUnclearPurpose',
105 linkWithUnclearPurposeSelectors);
106 },
82 }; 107 };
83 108
84 /** 109 /**
85 * Wait for all targets to be hidden. 110 * Wait for all targets to be hidden.
86 * @param {Array<Element>} targets 111 * @param {Array<Element>} targets
87 */ 112 */
88 function waitUntilHidden(targets) { 113 function waitUntilHidden(targets) {
89 function isHidden(el) { return el.hidden; } 114 function isHidden(el) { return el.hidden; }
90 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } 115 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); }
91 116
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 * @constructor 396 * @constructor
372 */ 397 */
373 function OptionsWebUIExtendedTest() {} 398 function OptionsWebUIExtendedTest() {}
374 399
375 OptionsWebUIExtendedTest.prototype = { 400 OptionsWebUIExtendedTest.prototype = {
376 __proto__: OptionsWebUITest.prototype, 401 __proto__: OptionsWebUITest.prototype,
377 402
378 /** @override */ 403 /** @override */
379 typedefCppFixture: 'OptionsBrowserTest', 404 typedefCppFixture: 'OptionsBrowserTest',
380 405
406 /** @override */
407 setUp: function() {
408 OptionsWebUITest.prototype.setUp.call(this);
409
410 // Enable when failure is resolved.
411 // AX_ARIA_10: http://crbug.com/559329
412 this.accessibilityAuditConfig.ignoreSelectors(
413 'unsupportedAriaAttribute',
414 '#profiles-list');
415
416 var controlsWithoutLabelSelectors = [
417 '#cookies-view-page > .content-area.cookies-list-content-area > *',
418 '#other-search-engine-list > .deletable-item > DIV > *',
419 ];
420
421 // Enable when failure is resolved.
422 // AX_TEXT_01: http://crbug.com/559330
423 this.accessibilityAuditConfig.ignoreSelectors(
424 'controlsWithoutLabel',
425 controlsWithoutLabelSelectors);
426
427 var linkWithUnclearPurposeSelectors = [
428 '#sync-overview > A',
429 '#privacy-explanation > A',
430 '#languages-section > .settings-row > A',
431 '#cloudprint-options-mdns > .settings-row > A',
432 // Selectors below only affect ChromeOS tests.
433 '#privacy-section > DIV > DIV:nth-of-type(9) > A',
434 '#accessibility-learn-more',
435 ];
436
437 // Enable when failure is resolved.
438 // AX_TEXT_04: http://crbug.com/559326
439 this.accessibilityAuditConfig.ignoreSelectors(
440 'linkWithUnclearPurpose',
441 linkWithUnclearPurposeSelectors);
442 },
443
381 testGenPreamble: function() { 444 testGenPreamble: function() {
382 // Start with no supervised users managed by this profile. 445 // Start with no supervised users managed by this profile.
383 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); 446 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");');
384 }, 447 },
385 448
386 /** 449 /**
387 * Asserts that two non-nested arrays are equal. The arrays must contain only 450 * Asserts that two non-nested arrays are equal. The arrays must contain only
388 * plain data types, no nested arrays or other objects. 451 * plain data types, no nested arrays or other objects.
389 * @param {Array} expected An array of expected values. 452 * @param {Array} expected An array of expected values.
390 * @param {Array} result An array of actual values. 453 * @param {Array} result An array of actual values.
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 __proto__: OptionsWebUIExtendedTest.prototype, 935 __proto__: OptionsWebUIExtendedTest.prototype,
873 936
874 /** @override */ 937 /** @override */
875 browsePreload: 'chrome://settings-frame/nonexistantPage', 938 browsePreload: 'chrome://settings-frame/nonexistantPage',
876 }; 939 };
877 940
878 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { 941 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() {
879 assertEquals('chrome://settings-frame/', document.location.href); 942 assertEquals('chrome://settings-frame/', document.location.href);
880 this.verifyHistory_([''], testDone); 943 this.verifyHistory_([''], testDone);
881 }); 944 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698