| Index: chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
|
| diff --git a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
|
| index c6467b22fbc5e9f5721db8d886803ffce7f848a1..69cc4744e31bf732bb86696a83ca931db0ce741c 100644
|
| --- a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
|
| +++ b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
|
| @@ -39,13 +39,13 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() {
|
| assertEquals(self.browsePreload, document.location.href,
|
| 'Unexpected URL loaded');
|
|
|
| - var passwordList = [{origin: 'anotherwebsite.com',
|
| + var passwordList = [{shownUrl: 'anotherwebsite.com',
|
| username: 'luigi',
|
| password: '*******'},
|
| - {origin: 'longwebsite.com',
|
| + {shownUrl: 'longwebsite.com',
|
| username: 'peach',
|
| password: '***'},
|
| - {origin: 'website.com',
|
| + {shownUrl: 'website.com',
|
| username: 'mario',
|
| password: '*******'}];
|
|
|
| @@ -62,20 +62,30 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() {
|
| 'Failed to pass list of passwords to iron-list');
|
|
|
| var list = Polymer.dom(passwordsSection.$.passwordList);
|
| - assertTrue(!!list, "Failed to get the password list");
|
| + assertTrue(!!list, 'Failed to get the password list');
|
| // Skip the first child because it's the template.
|
| var listChildren = list.children.slice(1);
|
|
|
| + /**
|
| + * Helper method that validates a node matches the data for an index.
|
| + * @param {Array<Element>} nodes The nodes that will be checked.
|
| + * @param {Array<Object>} passwordList The expected data.
|
| + * @param {number} index The index that should match the node and data.
|
| + */
|
| var validate = function(nodes, passwordList, index) {
|
| - assertTrue(!!nodes[index], 'Failed to get nodes[' + index + ']');
|
| - assertEquals(passwordList[index].origin,
|
| - nodes[index].querySelector('#origin').textContent,
|
| - 'origin mismatch in nodes[' + index + ']');
|
| - assertEquals(passwordList[index].username,
|
| - nodes[index].querySelector('#username').textContent,
|
| + var node = nodes[index];
|
| + var passwordInfo = passwordList[index];
|
| + assertTrue(!!node, 'Failed to get nodes[' + index + ']');
|
| + assertTrue(!!passwordInfo,
|
| + 'Failed to get passwordList[' + index + ']');
|
| + assertEquals(passwordInfo.shownUrl,
|
| + node.querySelector('#shownUrl').textContent,
|
| + 'shownUrl mismatch in nodes[' + index + ']');
|
| + assertEquals(passwordInfo.username,
|
| + node.querySelector('#username').textContent,
|
| 'username mismatch in nodes[' + index + ']');
|
| - assertEquals(passwordList[index].password,
|
| - nodes[index].querySelector('#password').textContent,
|
| + assertEquals(passwordInfo.password,
|
| + node.querySelector('#password').value,
|
| 'password mismatch in nodes[' + index + ']');
|
| };
|
|
|
|
|