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 c74d561161d25c81e51267e9870b9cd399b582f5..7bd4f386409a63e4bd140a5e43fe6ee82d363223 100644 |
--- a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js |
+++ b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js |
@@ -129,7 +129,7 @@ SettingsPasswordSectionBrowserTest.prototype = { |
/** |
* Helper method used to test for a url in a list of passwords. |
* @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList |
- * @param {!string} url The URL that is being searched for. |
+ * @param {string} url The URL that is being searched for. |
*/ |
listContainsUrl(passwordList, url) { |
for (var i = 0; i < passwordList.length; ++i) { |
@@ -142,7 +142,7 @@ SettingsPasswordSectionBrowserTest.prototype = { |
/** |
* Helper method used to test for a url in a list of passwords. |
* @param {!Array<!chrome.passwordsPrivate.ExceptionPair>} exceptionList |
- * @param {!string} url The URL that is being searched for. |
+ * @param {string} url The URL that is being searched for. |
*/ |
exceptionsListContainsUrl(exceptionList, url) { |
for (var i = 0; i < exceptionList.length; ++i) { |
@@ -268,6 +268,58 @@ TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { |
clickRemoveButton(); |
}); |
+ test('verifyFilterPasswords', function() { |
+ var passwordList = [ |
+ FakeDataMaker.passwordEntry('one.com', 'show', 5), |
+ FakeDataMaker.passwordEntry('two.com', 'shower', 3), |
+ FakeDataMaker.passwordEntry('three.com/show', 'four', 1), |
+ FakeDataMaker.passwordEntry('four.com', 'three', 2), |
+ FakeDataMaker.passwordEntry('five.com', 'two', 4), |
+ FakeDataMaker.passwordEntry('six-show.com', 'one', 6), |
+ ]; |
+ |
+ var passwordsSection = self.createPasswordsSection_(passwordList, []); |
+ passwordsSection.filter = 'show'; |
+ Polymer.dom.flush(); |
+ |
+ var expectedPasswordList = [ |
+ FakeDataMaker.passwordEntry('one.com', 'show', 5), |
+ FakeDataMaker.passwordEntry('two.com', 'shower', 3), |
+ FakeDataMaker.passwordEntry('three.com/show', 'four', 1), |
+ FakeDataMaker.passwordEntry('six-show.com', 'one', 6), |
+ ]; |
+ |
+ self.validatePasswordList( |
+ self.getIronListChildren_(passwordsSection.$.passwordList), |
+ expectedPasswordList); |
+ }); |
+ |
+ test('verifyFilterPasswordExceptions', function() { |
+ var exceptionList = [ |
+ FakeDataMaker.exceptionEntry('docsshow.google.com'), |
+ FakeDataMaker.exceptionEntry('showmail.com'), |
+ FakeDataMaker.exceptionEntry('google.com'), |
+ FakeDataMaker.exceptionEntry('inbox.google.com'), |
+ FakeDataMaker.exceptionEntry('mapsshow.google.com'), |
+ FakeDataMaker.exceptionEntry('plus.google.comshow'), |
+ ]; |
+ |
+ var passwordsSection = self.createPasswordsSection_([], exceptionList); |
+ passwordsSection.filter = 'show'; |
+ Polymer.dom.flush(); |
+ |
+ var expectedExceptionList = [ |
+ FakeDataMaker.exceptionEntry('docsshow.google.com'), |
+ FakeDataMaker.exceptionEntry('showmail.com'), |
+ FakeDataMaker.exceptionEntry('mapsshow.google.com'), |
+ FakeDataMaker.exceptionEntry('plus.google.comshow'), |
+ ]; |
+ |
+ self.validateExceptionList_( |
+ self.getIronListChildren_(passwordsSection.$.passwordExceptionsList), |
+ expectedExceptionList); |
+ }); |
+ |
test('verifyPasswordExceptions', function() { |
var exceptionList = [ |
FakeDataMaker.exceptionEntry('docs.google.com'), |