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

Unified Diff: components/autofill/core/browser/autofill_manager_unittest.cc

Issue 2897573003: Reland - [Autofill] Enable Autofill UKM by default. (Closed)
Patch Set: Rebase Created 3 years, 7 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
Index: components/autofill/core/browser/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index f1307e51193e67fbcf8c43add254d74f3bb571a2..4421a1d4a9d84c34d13c7e662d5b5c8dbc4a9d67 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -1070,13 +1070,9 @@ class AutofillManagerTest : public testing::Test {
security_state::kHttpFormWarningFeature);
}
- void EnableUkmLogging() {
- scoped_feature_list_.InitAndEnableFeature(kAutofillUkmLogging);
- }
-
- void EnableAutofillUpstreamRequestCvcIfMissingExperimentAndUkmLogging() {
+ void EnableAutofillUpstreamRequestCvcIfMissingExperiment() {
scoped_feature_list_.InitWithFeatures(
- {kAutofillUpstreamRequestCvcIfMissing, kAutofillUkmLogging}, {});
+ {kAutofillUpstreamRequestCvcIfMissing}, {});
}
void DisableAutofillUpstreamUseAutofillProfileComparatorForName() {
@@ -3679,6 +3675,7 @@ TEST_F(AutofillManagerTest, FormSubmittedServerTypes) {
// Set up our form data.
FormData form;
test::CreateTestAddressFormData(&form);
+ FormsSeen(std::vector<FormData>(1, form));
// Simulate having seen this form on page load.
// |form_structure| will be owned by |autofill_manager_|.
@@ -3718,6 +3715,7 @@ TEST_F(AutofillManagerTest, FormSubmittedPossibleTypesTwoSubmissions) {
FormData form;
std::vector<ServerFieldTypeSet> expected_types;
test::CreateTestAddressFormData(&form, &expected_types);
+ FormsSeen(std::vector<FormData>(1, form));
// Fill the form.
const char guid[] = "00000000-0000-0000-0000-000000000001";
@@ -4638,7 +4636,6 @@ TEST_F(AutofillManagerTest, FillInUpdatedExpirationDate) {
}
TEST_F(AutofillManagerTest, UploadCreditCard) {
- EnableUkmLogging();
personal_data_.ClearCreditCards();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -4770,7 +4767,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_FeatureNotEnabled) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_CvcUnavailable) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -4822,7 +4818,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_CvcUnavailable) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_CvcInvalidLength) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -4871,7 +4866,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_CvcInvalidLength) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_MultipleCvcFields) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -4932,7 +4926,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_MultipleCvcFields) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoCvcFieldOnForm) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -4988,7 +4981,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoCvcFieldOnForm) {
TEST_F(AutofillManagerTest,
UploadCreditCard_NoCvcFieldOnForm_InvalidCvcInNonCvcField) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -5047,7 +5039,6 @@ TEST_F(AutofillManagerTest,
TEST_F(AutofillManagerTest,
UploadCreditCard_NoCvcFieldOnForm_CvcInNonCvcField) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -5108,7 +5099,6 @@ TEST_F(AutofillManagerTest,
TEST_F(AutofillManagerTest,
UploadCreditCard_NoCvcFieldOnForm_CvcInAddressField) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -5175,7 +5165,7 @@ TEST_F(AutofillManagerTest,
#endif
TEST_F(AutofillManagerTest,
MAYBE_UploadCreditCard_NoCvcFieldOnForm_UserEntersCvc) {
- EnableAutofillUpstreamRequestCvcIfMissingExperimentAndUkmLogging();
+ EnableAutofillUpstreamRequestCvcIfMissingExperiment();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -5235,7 +5225,6 @@ TEST_F(AutofillManagerTest,
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoCvcFieldOnFormExperimentOff) {
- EnableUkmLogging();
autofill_manager_->set_credit_card_upload_enabled(true);
// Remove the profiles that were created in the TestPersonalDataManager
@@ -5300,7 +5289,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoCvcFieldOnFormExperimentOff) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoProfileAvailable) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5348,7 +5336,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoRecentlyUsedProfile) {
TestAutofillClock test_clock;
test_clock.SetNow(kArbitraryTime);
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5449,7 +5436,6 @@ TEST_F(AutofillManagerTest,
TEST_F(AutofillManagerTest,
UploadCreditCard_CvcUnavailableAndNoProfileAvailable) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5500,7 +5486,6 @@ TEST_F(AutofillManagerTest,
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoNameAvailable) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5549,7 +5534,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoNameAvailable) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesConflict) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5599,7 +5583,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesConflict) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesHavePrefixMatch) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5646,7 +5629,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_ZipCodesHavePrefixMatch) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoZipCodeAvailable) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5692,7 +5674,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_NoZipCodeAvailable) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_CCFormHasMiddleInitial) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5783,7 +5764,6 @@ TEST_F(AutofillManagerTest,
}
TEST_F(AutofillManagerTest, UploadCreditCard_NoMiddleInitialInCCForm) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5868,7 +5848,6 @@ TEST_F(AutofillManagerTest,
}
TEST_F(AutofillManagerTest, UploadCreditCard_CCFormHasMiddleName) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5944,7 +5923,6 @@ TEST_F(AutofillManagerTest,
}
TEST_F(AutofillManagerTest, UploadCreditCard_CCFormRemovesMiddleName) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -5982,7 +5960,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_CCFormRemovesMiddleName) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_NamesHaveToMatch) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -6242,7 +6219,6 @@ TEST_F(AutofillManagerTest, UploadCreditCard_LogPreviousUseDate) {
}
TEST_F(AutofillManagerTest, UploadCreditCard_UploadDetailsFails) {
- EnableUkmLogging();
personal_data_.ClearAutofillProfiles();
autofill_manager_->set_credit_card_upload_enabled(true);
@@ -6891,7 +6867,6 @@ TEST_F(AutofillManagerTest, FormWithLongOptionValuesIsAcceptable) {
// Test that a sign-in form submission sends an upload with types matching the
// fields.
TEST_F(AutofillManagerTest, SignInFormSubmission_Upload) {
- EnableUkmLogging();
// Set up our form data (it's already filled out with user data).
FormData form;
form.origin = GURL("http://myform.com/form.html");
@@ -6909,6 +6884,7 @@ TEST_F(AutofillManagerTest, SignInFormSubmission_Upload) {
test::CreateTestFormField("Password", "pw", "secret", "password", &field);
form.fields.push_back(field);
+ FormsSeen(std::vector<FormData>(1, form));
types.clear();
types.insert(PASSWORD);
expected_types.push_back(types);
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.cc ('k') | components/autofill/core/browser/autofill_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698