Commit 2908f615 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Passwords] Suppress leak check for sync users with too many passwords

This CL doesn't allow sync users to trigger the local leak check if they
have too many passwords to complete the check.
They can circumvent this restriction by turning off sync temporarily.

Screenshot of the new state:
https://drive.google.com/a/google.com/file/d/1vwa-7a_pbp-hNbEeFX6K6_ePus4kjzZS/view?usp=sharing

Bug: 1047726, 1061109
Change-Id: Ic3de634d767ca11ebd85b6c217ca5d8985da606c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100789
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749790}
parent b0ee2d07
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</div> </div>
<cr-button id="controlPasswordCheckButton" <cr-button id="controlPasswordCheckButton"
on-click="onPasswordCheckButtonClick_" on-click="onPasswordCheckButtonClick_"
hidden$="[[isButtonHidden_(status_)]]"> hidden$="[[isButtonHidden_(status_, suppressCheckupLink_)]]">
[[getButtonText_(status_)]] [[getButtonText_(status_)]]
</cr-button> </cr-button>
</div> </div>
......
...@@ -332,8 +332,9 @@ Polymer({ ...@@ -332,8 +332,9 @@ Polymer({
case CheckState.SIGNED_OUT: case CheckState.SIGNED_OUT:
case CheckState.NO_PASSWORDS: case CheckState.NO_PASSWORDS:
case CheckState.OTHER_ERROR: case CheckState.OTHER_ERROR:
case CheckState.TOO_MANY_PASSWORDS:
return false; return false;
case CheckState.TOO_MANY_PASSWORDS:
return !this.suppressesCheckupLink_();
case CheckState.TOO_MANY_PASSWORDS_AND_QUOTA_LIMIT: case CheckState.TOO_MANY_PASSWORDS_AND_QUOTA_LIMIT:
case CheckState.QUOTA_LIMIT: case CheckState.QUOTA_LIMIT:
return true; return true;
......
...@@ -153,9 +153,9 @@ cr.define('settings_passwords_check', function() { ...@@ -153,9 +153,9 @@ cr.define('settings_passwords_check', function() {
}); });
}); });
// Test verifies that too many passwords don't prevent the user from // Test verifies that sync users see only the link to account checkup and no
// starting the check. Additionally, display a link to account checkup. // button to start the local leak check.
test('testCheckupLinkForTooManyPasswordsWhenSyncing', function() { test('testOnlyCheckupLinkForTooManyPasswordsWhenSyncing', function() {
passwordManager.data.checkStatus = passwordManager.data.checkStatus =
autofill_test_util.makePasswordCheckStatus( autofill_test_util.makePasswordCheckStatus(
/*state=*/ PasswordCheckState.TOO_MANY_PASSWORDS); /*state=*/ PasswordCheckState.TOO_MANY_PASSWORDS);
...@@ -167,10 +167,7 @@ cr.define('settings_passwords_check', function() { ...@@ -167,10 +167,7 @@ cr.define('settings_passwords_check', function() {
return passwordManager.whenCalled('getPasswordCheckStatus').then(() => { return passwordManager.whenCalled('getPasswordCheckStatus').then(() => {
expectTrue(isElementVisible(section.$.linkToGoogleAccount)); expectTrue(isElementVisible(section.$.linkToGoogleAccount));
assertTrue(isElementVisible(section.$.controlPasswordCheckButton)); expectFalse(isElementVisible(section.$.controlPasswordCheckButton));
expectEquals(
section.i18n('checkPasswordsAgain'),
section.$.controlPasswordCheckButton.innerText);
}); });
}); });
......
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