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

Unified Diff: chrome/test/data/webui/settings/settings_passwords_section_browsertest.js

Issue 2170713002: Use dom-repeat for addresses, credit cards, and exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/settings/settings_autofill_section_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/test/data/webui/settings/settings_autofill_section_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698