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

Side by Side Diff: chrome/test/data/webui/settings/settings_passwords_section_browsertest.js

Issue 2818283002: MD-Settings: A11y - Fix password list focusability. (Closed)
Patch Set: nit Created 3 years, 7 months 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
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** @fileoverview Runs the Polymer Password Settings tests. */ 5 /** @fileoverview Runs the Polymer Password Settings tests. */
6 6
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 * @private 54 * @private
55 */ 55 */
56 function validatePasswordList(listElement, passwordList) { 56 function validatePasswordList(listElement, passwordList) {
57 assertEquals(passwordList.length, listElement.items.length); 57 assertEquals(passwordList.length, listElement.items.length);
58 if (passwordList.length > 0) { 58 if (passwordList.length > 0) {
59 // The first child is a template, skip and get the real 'first child'. 59 // The first child is a template, skip and get the real 'first child'.
60 var node = Polymer.dom(listElement).children[1]; 60 var node = Polymer.dom(listElement).children[1];
61 assert(node); 61 assert(node);
62 var passwordInfo = passwordList[0]; 62 var passwordInfo = passwordList[0];
63 assertEquals(passwordInfo.loginPair.urls.shown, 63 assertEquals(passwordInfo.loginPair.urls.shown,
64 node.querySelector('#originUrl').textContent.trim()); 64 node.$$('#originUrl').textContent.trim());
65 assertEquals(passwordInfo.loginPair.urls.link, 65 assertEquals(passwordInfo.loginPair.urls.link,
66 node.querySelector('#originUrl').href); 66 node.$$('#originUrl').href);
67 assertEquals(passwordInfo.loginPair.username, 67 assertEquals(passwordInfo.loginPair.username,
68 node.querySelector('#username').textContent); 68 node.$$('#username').textContent);
69 assertEquals(passwordInfo.numCharactersInPassword, 69 assertEquals(passwordInfo.numCharactersInPassword,
70 node.querySelector('#password').value.length); 70 node.$$('#password').value.length);
71 } 71 }
72 } 72 }
73 73
74 /** 74 /**
75 * Helper method that validates a that elements in the exception list match 75 * Helper method that validates a that elements in the exception list match
76 * the expected data. 76 * the expected data.
77 * @param {!Array<!Element>} nodes The nodes that will be checked. 77 * @param {!Array<!Element>} nodes The nodes that will be checked.
78 * @param {!Array<!chrome.passwordsPrivate.ExceptionEntry>} exceptionList The 78 * @param {!Array<!chrome.passwordsPrivate.ExceptionEntry>} exceptionList The
79 * expected data. 79 * expected data.
80 * @private 80 * @private
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 assertEquals(firstPassword.loginPair.urls.origin, detail.urls.origin); 276 assertEquals(firstPassword.loginPair.urls.origin, detail.urls.origin);
277 assertEquals(firstPassword.loginPair.username, detail.username); 277 assertEquals(firstPassword.loginPair.username, detail.username);
278 278
279 // Clean up after self. 279 // Clean up after self.
280 passwordManager.onRemoveSavedPassword = null; 280 passwordManager.onRemoveSavedPassword = null;
281 281
282 done(); 282 done();
283 }; 283 };
284 284
285 // Click the remove button on the first password. 285 // Click the remove button on the first password.
286 MockInteractions.tap(firstNode.querySelector('#passwordMenu')); 286 MockInteractions.tap(firstNode.$$('#passwordMenu'));
287 MockInteractions.tap(passwordsSection.$.menuRemovePassword); 287 MockInteractions.tap(passwordsSection.$.menuRemovePassword);
288 }); 288 });
289 289
290 test('verifyFilterPasswords', function() { 290 test('verifyFilterPasswords', function() {
291 var passwordList = [ 291 var passwordList = [
292 FakeDataMaker.passwordEntry('one.com', 'show', 5), 292 FakeDataMaker.passwordEntry('one.com', 'show', 5),
293 FakeDataMaker.passwordEntry('two.com', 'shower', 3), 293 FakeDataMaker.passwordEntry('two.com', 'shower', 3),
294 FakeDataMaker.passwordEntry('three.com/show', 'four', 1), 294 FakeDataMaker.passwordEntry('three.com/show', 'four', 1),
295 FakeDataMaker.passwordEntry('four.com', 'three', 2), 295 FakeDataMaker.passwordEntry('four.com', 'three', 2),
296 FakeDataMaker.passwordEntry('five.com', 'two', 4), 296 FakeDataMaker.passwordEntry('five.com', 'two', 4),
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 assertEquals(item.loginPair.username, event.detail.username); 489 assertEquals(item.loginPair.username, event.detail.username);
490 done(); 490 done();
491 }); 491 });
492 492
493 MockInteractions.tap(passwordDialog.$.showPasswordButton); 493 MockInteractions.tap(passwordDialog.$.showPasswordButton);
494 }); 494 });
495 }); 495 });
496 496
497 mocha.run(); 497 mocha.run();
498 }); 498 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698