Commit d1bdf26f authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Passwords] Hide leak check button without passwords

Users should not be able to retry the passwords check immediately if
they don't have passwords to check.
Saving at least one password will put it back into an idle state.

Screenshots are in the linked bug.

Bug: 1061935
Change-Id: I2eb101a32ca5a6a44e86a7cfbd458af1fd2efec3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105220
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750610}
parent 2c45ece6
......@@ -164,11 +164,11 @@ Polymer({
case CheckState.CANCELED:
case CheckState.OFFLINE:
case CheckState.SIGNED_OUT:
case CheckState.NO_PASSWORDS:
case CheckState.OTHER_ERROR:
case CheckState.TOO_MANY_PASSWORDS:
this.passwordManager_.startBulkPasswordCheck();
return;
case CheckState.NO_PASSWORDS:
case CheckState.TOO_MANY_PASSWORDS_AND_QUOTA_LIMIT:
case CheckState.QUOTA_LIMIT:
}
......@@ -353,11 +353,11 @@ Polymer({
case CheckState.RUNNING:
case CheckState.OFFLINE:
case CheckState.SIGNED_OUT:
case CheckState.NO_PASSWORDS:
case CheckState.OTHER_ERROR:
return false;
case CheckState.TOO_MANY_PASSWORDS:
return !this.suppressesCheckupLink_();
case CheckState.NO_PASSWORDS:
case CheckState.TOO_MANY_PASSWORDS_AND_QUOTA_LIMIT:
case CheckState.QUOTA_LIMIT:
return true;
......
......@@ -321,22 +321,17 @@ cr.define('settings_passwords_check', function() {
.then(() => passwordManager.whenCalled('startBulkPasswordCheck'));
});
// Test verifies that 'Try again' visible and working when users encounter a
// Test verifies that 'Try again' is hidden when users encounter a
// no-saved-passwords error.
test('testShowRetryAfterNoPasswordsError', function() {
test('testHideRetryAfterNoPasswordsError', function() {
passwordManager.data.checkStatus =
autofill_test_util.makePasswordCheckStatus(
/*state=*/ PasswordCheckState.NO_PASSWORDS);
const section = createCheckPasswordSection();
return passwordManager.whenCalled('getPasswordCheckStatus')
.then(() => {
assertTrue(isElementVisible(section.$.controlPasswordCheckButton));
expectEquals(
section.i18n('checkPasswordsAgainAfterError'),
section.$.controlPasswordCheckButton.innerText);
section.$.controlPasswordCheckButton.click();
})
.then(() => passwordManager.whenCalled('startBulkPasswordCheck'));
expectFalse(isElementVisible(section.$.controlPasswordCheckButton));
});
});
// Test verifies that 'Try again' visible and working when users encounter a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment