Chromium Code Reviews| 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 d4d6f256bebd0e7ba261c4894fd1356bff89f68e..732271a32040c57a7412a900861b1407587bd29f 100644 |
| --- a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js |
| +++ b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js |
| @@ -84,6 +84,17 @@ SettingsPasswordSectionBrowserTest.prototype = { |
| }, |
| /** |
| + * Returns all children of an element that has children added by a dom-repeat. |
| + * @param {!Element} element |
| + * @return {!Array<!Element>} |
| + * @private |
| + */ |
| + getDomRepeatChildren_: function(element) { |
| + // The template is at the end of the list of children and should be skipped. |
| + return Array.prototype.slice.call(element.children, 0, -1); |
|
michaelpg
2016/07/26 20:28:39
Do you think we should assert the last element is
hcarmona
2016/07/26 22:08:15
Done.
|
| + }, |
| + |
| + /** |
| * Skips over the template and returns all visible children of an iron-list. |
| * @param {!Element} ironList |
| * @return {!Array<!Element>} |
| @@ -159,7 +170,6 @@ SettingsPasswordSectionBrowserTest.prototype = { |
| */ |
| flushPasswordSection_: function(passwordsSection) { |
| passwordsSection.$.passwordList.notifyResize(); |
| - passwordsSection.$.passwordExceptionsList.notifyResize(); |
| Polymer.dom.flush(); |
| }, |
| }; |
| @@ -316,7 +326,7 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| ]; |
| self.validateExceptionList_( |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList), |
| expectedExceptionList); |
| }); |
| @@ -332,13 +342,8 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| var passwordsSection = self.createPasswordsSection_([], exceptionList); |
| - // Assert that the data is passed into the iron list. If this fails, |
| - // then other expectations will also fail. |
| - assertEquals(exceptionList, |
| - passwordsSection.$.passwordExceptionsList.items); |
| - |
| self.validateExceptionList_( |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList), |
| exceptionList); |
| }); |
| @@ -356,7 +361,7 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| var passwordsSection = self.createPasswordsSection_([], exceptionList); |
| self.validateExceptionList_( |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList), |
| exceptionList); |
| // Simulate 'mail.com' being removed from the list. |
| @@ -367,7 +372,7 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| self.flushPasswordSection_(passwordsSection); |
| self.validateExceptionList_( |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList), |
| exceptionList); |
| }); |
| @@ -386,7 +391,7 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| var passwordsSection = self.createPasswordsSection_([], exceptionList); |
| var exceptions = |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList); |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList); |
| // The index of the button currently being checked. |
| var index = 0; |