| OLD | NEW |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 * @private | 48 * @private |
| 49 */ | 49 */ |
| 50 validatePasswordList: function(listElement, passwordList) { | 50 validatePasswordList: function(listElement, passwordList) { |
| 51 assertEquals(passwordList.length, listElement.items.length); | 51 assertEquals(passwordList.length, listElement.items.length); |
| 52 if (passwordList.length > 0) { | 52 if (passwordList.length > 0) { |
| 53 // The first child is a template, skip and get the real 'first child'. | 53 // The first child is a template, skip and get the real 'first child'. |
| 54 var node = Polymer.dom(listElement).children[1]; | 54 var node = Polymer.dom(listElement).children[1]; |
| 55 assert(node); | 55 assert(node); |
| 56 var passwordInfo = passwordList[0]; | 56 var passwordInfo = passwordList[0]; |
| 57 assertEquals(passwordInfo.loginPair.originUrl, | 57 assertEquals(passwordInfo.loginPair.originUrl, |
| 58 node.querySelector('#originUrl').textContent); | 58 node.querySelector('#originUrl').textContent.trim()); |
| 59 assertEquals(passwordInfo.linkUrl, | 59 assertEquals(passwordInfo.linkUrl, |
| 60 node.querySelector('#originUrl').href); | 60 node.querySelector('#originUrl').href); |
| 61 assertEquals(passwordInfo.loginPair.username, | 61 assertEquals(passwordInfo.loginPair.username, |
| 62 node.querySelector('#username').textContent); | 62 node.querySelector('#username').textContent); |
| 63 assertEquals(passwordInfo.numCharactersInPassword, | 63 assertEquals(passwordInfo.numCharactersInPassword, |
| 64 node.querySelector('#password').value.length); | 64 node.querySelector('#password').value.length); |
| 65 } | 65 } |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** | 68 /** |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 assertEquals(item.loginPair.username, event.detail.username); | 442 assertEquals(item.loginPair.username, event.detail.username); |
| 443 done(); | 443 done(); |
| 444 }); | 444 }); |
| 445 | 445 |
| 446 MockInteractions.tap(passwordDialog.$.showPasswordButton); | 446 MockInteractions.tap(passwordDialog.$.showPasswordButton); |
| 447 }); | 447 }); |
| 448 }); | 448 }); |
| 449 | 449 |
| 450 mocha.run(); | 450 mocha.run(); |
| 451 }); | 451 }); |
| OLD | NEW |