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 dd22d9b5668c1fc372a55076f89ea9d2d5a3a8f7..46ac511e0b29c9e74ca377d378bcb6dfcd8c3109 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,16 @@ 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) { |
| + return Array.prototype.slice.call(element.children, 0, -1); |
|
michaelpg
2016/07/21 03:56:13
Comment here what the -1 is for (the <template>)
hcarmona
2016/07/26 18:28:48
Done.
|
| + }, |
| + |
| + /** |
| * Skips over the template and returns all visible children of an iron-list. |
| * @param {!Element} ironList |
| * @return {!Array<!Element>} |
| @@ -159,7 +169,6 @@ SettingsPasswordSectionBrowserTest.prototype = { |
| */ |
| flushPasswordSection_: function(passwordsSection) { |
| passwordsSection.$.passwordList.notifyResize(); |
| - passwordsSection.$.passwordExceptionsList.notifyResize(); |
| Polymer.dom.flush(); |
| }, |
| }; |
| @@ -280,13 +289,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); |
| }); |
| @@ -304,7 +308,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. |
| @@ -315,7 +319,7 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
| self.flushPasswordSection_(passwordsSection); |
| self.validateExceptionList_( |
| - self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
| + self.getDomRepeatChildren_(passwordsSection.$.passwordExceptionsList), |
| exceptionList); |
| }); |
| @@ -334,7 +338,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; |