Skip to content

Commit

Permalink
[Passwords] Cleanup kReparseServerPredictionsFollowingFormChange.
Browse files Browse the repository at this point in the history
The feature was launched a while ago.

Bug: 1313893
Change-Id: I1d7255db4c1559d34f8b1dd10c29e04658909174
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3571771
Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Elias Khsheibun <eliaskh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#989443}
  • Loading branch information
Elias authored and Chromium LUCI CQ committed Apr 6, 2022
1 parent 7127b13 commit c47a06d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ bool FormContainsFieldWithName(const FormData& form,
return false;
}

// Returns whether reparsing server predictions following a form change is
// enabled.
bool IsReparsingServerPredictionsEnabled() {
return base::FeatureList::IsEnabled(
features::kReparseServerPredictionsFollowingFormChange);
}

bool IsUsernameFirstFlowFeatureEnabled() {
return base::FeatureList::IsEnabled(features::kUsernameFirstFlow);
}
Expand Down Expand Up @@ -883,8 +876,7 @@ void PasswordFormManager::FillForm(
bool new_predictions_available = false;
if (differences_bitmask) {
UpdateFormManagerWithFormChanges(observed_form_data, predictions);
new_predictions_available =
parser_.predictions() && IsReparsingServerPredictionsEnabled();
new_predictions_available = parser_.predictions().has_value();
}
// Fill the form if relevant form predictions were found or if the
// manager is not waiting for new server predictions.
Expand Down Expand Up @@ -1108,8 +1100,6 @@ void PasswordFormManager::UpdateFormManagerWithFormChanges(
const FormData& observed_form_data,
const std::map<FormSignature, FormPredictions>& predictions) {
*mutable_observed_form() = observed_form_data;
if (!IsReparsingServerPredictionsEnabled())
return;

// If the observed form has changed, it might be autofilled again.
autofills_left_ = kMaxTimesAutofill;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3902,12 +3902,6 @@ TEST_P(PasswordManagerTest,
}

TEST_P(PasswordManagerTest, GenerationOnChangedForm) {
const bool kIsReparsingEnabled = GetParam();
base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatureState(
features::kReparseServerPredictionsFollowingFormChange,
kIsReparsingEnabled);

EXPECT_CALL(client_, IsSavingAndFillingEnabled(_))
.WillRepeatedly(Return(true));
EXPECT_CALL(*store_, GetLogins(_, _))
Expand Down Expand Up @@ -3950,16 +3944,12 @@ TEST_P(PasswordManagerTest, GenerationOnChangedForm) {
manager()->ProcessAutofillPredictions(&driver_, {&form_structure});

autofill::PasswordFormGenerationData form_generation_data;
if (kIsReparsingEnabled) {
EXPECT_CALL(driver_, FormEligibleForGenerationFound)
.WillOnce(SaveArg<0>(&form_generation_data));
// The change is discovered by PasswordManager.
manager()->OnPasswordFormsParsed(&driver_, {form_data});
EXPECT_EQ(new_password_field.unique_renderer_id,
form_generation_data.new_password_renderer_id);
} else {
EXPECT_CALL(driver_, FormEligibleForGenerationFound).Times(0);
}
EXPECT_CALL(driver_, FormEligibleForGenerationFound)
.WillOnce(SaveArg<0>(&form_generation_data));
// The change is discovered by PasswordManager.
manager()->OnPasswordFormsParsed(&driver_, {form_data});
EXPECT_EQ(new_password_field.unique_renderer_id,
form_generation_data.new_password_renderer_id);
}

TEST_P(PasswordManagerTest, SubmissionDetectedOnClearedForm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ const base::Feature kPasswordScriptsFetching = {
const base::Feature kRecoverFromNeverSaveAndroid = {
"RecoverFromNeverSaveAndroid", base::FEATURE_DISABLED_BY_DEFAULT};

// Enables reparsing server predictions once the password form manager notices a
// dynamic form change.
const base::Feature kReparseServerPredictionsFollowingFormChange = {
"ReparseServerPredictionsFollowingFormChange",
base::FEATURE_ENABLED_BY_DEFAULT};

// Enables considering secondary server field predictions during form parsing.
const base::Feature kSecondaryServerFieldPredictions = {
"SecondaryServerFieldPredictions", base::FEATURE_ENABLED_BY_DEFAULT};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ extern const base::Feature kPasswordReuseDetectionEnabled;
extern const base::Feature kPasswordsAccountStorageRevisedOptInFlow;
extern const base::Feature kPasswordScriptsFetching;
extern const base::Feature kRecoverFromNeverSaveAndroid;
extern const base::Feature kReparseServerPredictionsFollowingFormChange;
extern const base::Feature kSecondaryServerFieldPredictions;
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
extern const base::Feature kSkipUndecryptablePasswords;
Expand Down

0 comments on commit c47a06d

Please sign in to comment.