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

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

Issue 646853004: Enable a11y audit for chrome://settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 1 month 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 /** 5 /**
6 * Returns the HTML element for the |field|. 6 * Returns the HTML element for the |field|.
7 * @param {string} field The field name for the element. 7 * @param {string} field The field name for the element.
8 * @return {HTMLElement} The HTML element. 8 * @return {HTMLElement} The HTML element.
9 */ 9 */
10 function getField(field) { 10 function getField(field) {
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 function AutofillOptionsWebUITest() {} 30 function AutofillOptionsWebUITest() {}
31 31
32 AutofillOptionsWebUITest.prototype = { 32 AutofillOptionsWebUITest.prototype = {
33 __proto__: testing.Test.prototype, 33 __proto__: testing.Test.prototype,
34 34
35 /** 35 /**
36 * Browse to autofill options. 36 * Browse to autofill options.
37 */ 37 */
38 browsePreload: 'chrome://settings-frame/autofill', 38 browsePreload: 'chrome://settings-frame/autofill',
39
40 /** @override */
41 runAccessibilityChecks: true,
42
43 /** @override */
44 accessibilityIssuesAreErrors: true,
45
46 /** override */
47 setUp: function() {
48 // user-image-stream is a streaming video element used for capturing a
49 // user image.
50 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions',
51 '.user-image-stream');
52 },
39 }; 53 };
40 54
41 // Test opening the autofill options has correct location. 55 // Test opening the autofill options has correct location.
42 TEST_F('AutofillOptionsWebUITest', 'testOpenAutofillOptions', function() { 56 TEST_F('AutofillOptionsWebUITest', 'testOpenAutofillOptions', function() {
43 assertEquals(this.browsePreload, document.location.href); 57 assertEquals(this.browsePreload, document.location.href);
44 }); 58 });
45 59
46 /** 60 /**
47 * TestFixture for autofill edit address overlay WebUI testing. 61 * TestFixture for autofill edit address overlay WebUI testing.
48 * @extends {testing.Test} 62 * @extends {testing.Test}
49 * @constructor 63 * @constructor
50 */ 64 */
51 function AutofillEditAddressWebUITest() {} 65 function AutofillEditAddressWebUITest() {}
52 66
53 AutofillEditAddressWebUITest.prototype = { 67 AutofillEditAddressWebUITest.prototype = {
54 __proto__: testing.Test.prototype, 68 __proto__: testing.Test.prototype,
55 69
70 /** @override */
71 runAccessibilityChecks: true,
72
73 /** @override */
74 accessibilityIssuesAreErrors: true,
75
56 /** @override */ 76 /** @override */
57 browsePreload: 'chrome://settings-frame/autofillEditAddress', 77 browsePreload: 'chrome://settings-frame/autofillEditAddress',
78
79 /** override */
80 setUp: function() {
81 // user-image-stream is a streaming video element used for capturing a
82 // user image.
83 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions',
84 '.user-image-stream');
85 },
58 }; 86 };
59 87
60 TEST_F('AutofillEditAddressWebUITest', 'testInitialFormLayout', function() { 88 TEST_F('AutofillEditAddressWebUITest', 'testInitialFormLayout', function() {
61 assertEquals(this.browsePreload, document.location.href); 89 assertEquals(this.browsePreload, document.location.href);
62 90
63 assertEquals(getField('country').value, ''); 91 assertEquals(getField('country').value, '');
64 assertEquals(0, getListSize(getField('phone'))); 92 assertEquals(0, getListSize(getField('phone')));
65 assertEquals(0, getListSize(getField('email'))); 93 assertEquals(0, getListSize(getField('email')));
66 assertEquals(0, getListSize(getField('fullName'))); 94 assertEquals(0, getListSize(getField('fullName')));
67 assertEquals('', getField('city').value); 95 assertEquals('', getField('city').value);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 phoneList.doneValidating().then(function() { 220 phoneList.doneValidating().then(function() {
193 phoneList.focus(); 221 phoneList.focus();
194 var input = phoneList.querySelector('input'); 222 var input = phoneList.querySelector('input');
195 input.focus(); 223 input.focus();
196 document.execCommand('insertText', false, '111-222-333'); 224 document.execCommand('insertText', false, '111-222-333');
197 assertEquals('111-222-333', input.value); 225 assertEquals('111-222-333', input.value);
198 input.blur(); 226 input.blur();
199 phoneList.doneValidating().then(testDone); 227 phoneList.doneValidating().then(testDone);
200 }); 228 });
201 }); 229 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698