Commit 6fb111eb authored by siyua's avatar siyua Committed by Commit Bot

[AF][Paradise] Enable migration flow for non-sync users

Also removed the EnableAutofillCreditCardLocalCardMigrationExperiment()
in unittests since as we add more experiment flags, this function does
not help.

Set a helper function in TestPersonalDataManager to change the sync
state, which can help us in case of such need in the future.

Bug: 897998
Change-Id: Id212077092d80738b8495f4b50bd7034e9f1ead6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1501754
Commit-Queue: Siyu An <siyua@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638336}
parent a909223e
......@@ -208,18 +208,24 @@ bool LocalCardMigrationManager::IsCreditCardMigrationEnabled() {
observer_for_testing_ ||
::autofill::IsCreditCardUploadEnabled(
client_->GetPrefs(), client_->GetSyncService(),
client_->GetIdentityManager()->GetPrimaryAccountInfo().email);
personal_data_manager_->GetAccountInfoForPaymentsServer().email);
bool has_google_payments_account =
(payments::GetBillingCustomerId(personal_data_manager_,
payments_client_->GetPrefService()) != 0);
bool sync_feature_enabled =
(personal_data_manager_->GetSyncSigninState() ==
AutofillSyncSigninState::kSignedInAndSyncFeature);
AutofillSyncSigninState sync_state =
personal_data_manager_->GetSyncSigninState();
return migration_experiment_enabled && credit_card_upload_enabled &&
has_google_payments_account && sync_feature_enabled;
has_google_payments_account &&
// User signed-in and turned sync on.
(sync_state == AutofillSyncSigninState::kSignedInAndSyncFeature ||
// User signed-in but not turned on sync.
(sync_state == AutofillSyncSigninState::
kSignedInAndWalletSyncTransportEnabled &&
base::FeatureList::IsEnabled(
features::kAutofillEnableLocalCardMigrationForNonSyncUser)));
}
void LocalCardMigrationManager::OnDidGetUploadDetails(
......
......@@ -29,6 +29,7 @@
#include "components/autofill/core/browser/mock_autocomplete_history_manager.h"
#include "components/autofill/core/browser/payments/test_payments_client.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/sync_utils.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
......@@ -112,16 +113,6 @@ class LocalCardMigrationManagerTest : public testing::Test {
request_context_ = nullptr;
}
void EnableAutofillCreditCardLocalCardMigrationExperiment() {
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
}
void DisableAutofillCreditCardLocalCardMigrationExperiment() {
scoped_feature_list_.InitAndDisableFeature(
features::kAutofillCreditCardLocalCardMigration);
}
void FormsSeen(const std::vector<FormData>& forms) {
autofill_manager_->OnFormsSeen(forms, base::TimeTicks());
}
......@@ -194,7 +185,8 @@ class LocalCardMigrationManagerTest : public testing::Test {
// Having one local card on file and using it will not trigger migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithOneLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -227,7 +219,8 @@ TEST_F(LocalCardMigrationManagerTest,
// trigger migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseNewCardWithAnyLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -257,7 +250,8 @@ TEST_F(LocalCardMigrationManagerTest,
// migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithMoreLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -303,7 +297,8 @@ TEST_F(LocalCardMigrationManagerTest,
// cards as long as the other local cards are not eligible for migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithInvalidLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -336,7 +331,8 @@ TEST_F(LocalCardMigrationManagerTest,
// will trigger migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseServerCardWithOneValidLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -385,7 +381,8 @@ TEST_F(LocalCardMigrationManagerTest,
// cards as long as the other local cards are not eligible for migration.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseServerCardWithNoneValidLocal) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -427,7 +424,8 @@ TEST_F(LocalCardMigrationManagerTest,
// is off, will not trigger migration.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_FeatureNotEnabled) {
// Turn off the experiment flag.
DisableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndDisableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -454,20 +452,22 @@ TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_FeatureNotEnabled) {
}
// Do not trigger migration if user only signs in.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_SignInOnly) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_SignInOnlyWhenExpOff) {
scoped_feature_list_.InitWithFeatures(
// Enabled
{features::kAutofillCreditCardLocalCardMigration,
features::kAutofillEnableAccountWalletStorage},
// Disabled
{features::kAutofillEnableLocalCardMigrationForNonSyncUser});
// Make a non-primary account available with both a refresh token and cookie
// to be in Sync Transport for Wallet mode, in which case this account is
// signed in only without sync enabled.
sync_service_.SetIsAuthenticatedAccountPrimary(false);
sync_service_.SetActiveDataTypes(
syncer::ModelTypeSet(syncer::AUTOFILL_WALLET_DATA));
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
autofill_client_.GetPrefs()->SetDouble(prefs::kAutofillBillingCustomerNumber,
12345);
base::test::ScopedFeatureList scoped_features;
scoped_features.InitWithFeatures(
/*enabled_features=*/{features::kAutofillEnableAccountWalletStorage},
/*disabled_features=*/{});
// Mock Chrome Sync is disabled.
local_card_migration_manager_->ResetSyncState(
AutofillSyncSigninState::kSignedInAndWalletSyncTransportEnabled);
// Add a local credit card whose |TypeAndLastFourDigits| matches what we will
// enter below.
......@@ -489,10 +489,50 @@ TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_SignInOnly) {
EXPECT_FALSE(local_card_migration_manager_->LocalCardMigrationWasTriggered());
}
// Trigger migration if user only signs in and if experiment is enabled.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_SignInOnlyWhenExpOn) {
scoped_feature_list_.InitWithFeatures(
// Enabled
{features::kAutofillCreditCardLocalCardMigration,
features::kAutofillEnableLocalCardMigrationForNonSyncUser,
features::kAutofillEnableAccountWalletStorage},
// Disabled
{});
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
autofill_client_.GetPrefs()->SetDouble(prefs::kAutofillBillingCustomerNumber,
12345);
// Mock Chrome Sync is disabled.
local_card_migration_manager_->ResetSyncState(
AutofillSyncSigninState::kSignedInAndWalletSyncTransportEnabled);
// Add a local credit card whose |TypeAndLastFourDigits| matches what we will
// enter below.
AddLocalCreditCard(personal_data_, "Flo Master", "4111111111111111", "11",
test::NextYear().c_str(), "1", "guid1");
// Add another local credit card.
AddLocalCreditCard(personal_data_, "Flo Master", "5555555555554444", "11",
test::NextYear().c_str(), "1", "guid2");
// Set up our credit card form data.
FormData credit_card_form;
test::CreateTestCreditCardFormData(&credit_card_form, true, false);
FormsSeen(std::vector<FormData>(1, credit_card_form));
// Edit the data, and submit.
EditCreditCardFrom(credit_card_form, "Flo Master", "4111111111111111", "11",
test::NextYear().c_str(), "123");
FormSubmitted(credit_card_form);
EXPECT_TRUE(local_card_migration_manager_->LocalCardMigrationWasTriggered());
}
// Use one local card with more valid local cards available but billing customer
// number is blank, will not trigger migration.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_NoPaymentsAccount) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Add a local credit card whose |TypeAndLastFourDigits| matches what we will
// enter below.
......@@ -518,7 +558,8 @@ TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_NoPaymentsAccount) {
// migratable.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_LocalCardMatchMaskedServerCard) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -555,7 +596,8 @@ TEST_F(LocalCardMigrationManagerTest,
// migratable.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_LocalCardMatchFullServerCard) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -587,7 +629,8 @@ TEST_F(LocalCardMigrationManagerTest,
// GetDetectedValues() should includes cardholder name if all cards have it.
TEST_F(LocalCardMigrationManagerTest, GetDetectedValues_AllWithCardHolderName) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -619,7 +662,8 @@ TEST_F(LocalCardMigrationManagerTest, GetDetectedValues_AllWithCardHolderName) {
// a cardholder name.
TEST_F(LocalCardMigrationManagerTest,
GetDetectedValues_OneCardWithoutCardHolderName) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -650,7 +694,8 @@ TEST_F(LocalCardMigrationManagerTest,
// account.
TEST_F(LocalCardMigrationManagerTest,
GetDetectedValues_IncludeGooglePaymentsAccount) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -681,7 +726,8 @@ TEST_F(LocalCardMigrationManagerTest,
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddMigrateCardsBillableServiceNumberInRequest) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -714,7 +760,8 @@ TEST_F(LocalCardMigrationManagerTest,
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddUploadCardSourceInRequest_CheckoutFlow) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -747,7 +794,8 @@ TEST_F(LocalCardMigrationManagerTest,
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddUploadCardSourceInRequest_SettingsPage) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -776,7 +824,8 @@ TEST_F(LocalCardMigrationManagerTest,
// be triggered.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_TriggerFromSettingsPage) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -815,7 +864,8 @@ TEST_F(LocalCardMigrationManagerTest,
// prompt are both triggered.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_TriggerFromSubmittedForm) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -846,7 +896,8 @@ TEST_F(LocalCardMigrationManagerTest,
// prompt are not triggered as user previously rejected the prompt.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_DontTriggerFromSubmittedForm) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -883,7 +934,8 @@ TEST_F(LocalCardMigrationManagerTest,
// Verify that given the parsed response from the payments client, the migration
// status is correctly set.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_MigrationSuccess) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -924,7 +976,8 @@ TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_MigrationSuccess) {
// status is correctly set.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrationTemporaryFailure) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -967,7 +1020,8 @@ TEST_F(LocalCardMigrationManagerTest,
// status is correctly set.
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrationPermanentFailure) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
// Set the billing_customer_number Priority Preference to designate
// existence of a Payments account.
......@@ -1008,7 +1062,8 @@ TEST_F(LocalCardMigrationManagerTest,
// Verify selected cards are correctly passed to manager.
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_ToggleIsChosen) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
AddLocalCreditCard(personal_data_, "Flo Master", "4111111111111111", "11",
test::NextYear().c_str(), "1", "guid1");
AddLocalCreditCard(personal_data_, "Flo Master", "5454545454545454", "11",
......@@ -1031,7 +1086,8 @@ TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_ToggleIsChosen) {
}
TEST_F(LocalCardMigrationManagerTest, DeleteLocalCardViaMigrationDialog) {
EnableAutofillCreditCardLocalCardMigrationExperiment();
scoped_feature_list_.InitAndEnableFeature(
features::kAutofillCreditCardLocalCardMigration);
AddLocalCreditCard(personal_data_, "Flo Master", "4111111111111111", "11",
test::NextYear().c_str(), "1", "guid1");
......
......@@ -126,7 +126,7 @@ class PersonalDataManager : public KeyedService,
void OnAccountsCookieDeletedByUserAction() override;
// Returns the current sync status.
AutofillSyncSigninState GetSyncSigninState() const;
virtual AutofillSyncSigninState GetSyncSigninState() const;
// Adds a listener to be notified of PersonalDataManager events.
virtual void AddObserver(PersonalDataManagerObserver* observer);
......
......@@ -8,7 +8,6 @@
#include "components/autofill/core/browser/payments/test_payments_client.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "services/identity/public/cpp/identity_manager.h"
namespace autofill {
......@@ -16,11 +15,12 @@ TestLocalCardMigrationManager::TestLocalCardMigrationManager(
AutofillDriver* driver,
AutofillClient* client,
payments::TestPaymentsClient* payments_client,
PersonalDataManager* personal_data_manager)
TestPersonalDataManager* personal_data_manager)
: LocalCardMigrationManager(client,
payments_client,
"en-US",
personal_data_manager) {}
personal_data_manager),
personal_data_manager_(personal_data_manager) {}
TestLocalCardMigrationManager::~TestLocalCardMigrationManager() {}
......@@ -28,10 +28,19 @@ bool TestLocalCardMigrationManager::IsCreditCardMigrationEnabled() {
bool migration_experiment_enabled =
features::GetLocalCardMigrationExperimentalFlag() !=
features::LocalCardMigrationExperimentalFlag::kMigrationDisabled;
bool has_google_payments_account =
(static_cast<int64_t>(payments_client_->GetPrefService()->GetDouble(
prefs::kAutofillBillingCustomerNumber)) != 0);
return migration_experiment_enabled && has_google_payments_account;
bool sync_feature_enabled =
(personal_data_manager_->GetSyncSigninState() ==
AutofillSyncSigninState::kSignedInAndSyncFeature);
return migration_experiment_enabled && has_google_payments_account &&
(sync_feature_enabled ||
base::FeatureList::IsEnabled(
features::kAutofillEnableLocalCardMigrationForNonSyncUser));
}
bool TestLocalCardMigrationManager::LocalCardMigrationWasTriggered() {
......@@ -58,6 +67,11 @@ void TestLocalCardMigrationManager::OnUserAcceptedMainMigrationDialog(
LocalCardMigrationManager::OnUserAcceptedMainMigrationDialog(selected_cards);
}
void TestLocalCardMigrationManager::ResetSyncState(
AutofillSyncSigninState sync_state) {
personal_data_manager_->SetSyncAndSignInState(sync_state);
}
void TestLocalCardMigrationManager::OnDidGetUploadDetails(
bool is_from_settings_page,
AutofillClient::PaymentsRpcResult result,
......
......@@ -8,6 +8,8 @@
#include <string>
#include "components/autofill/core/browser/local_card_migration_manager.h"
#include "components/autofill/core/browser/sync_utils.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
namespace autofill {
......@@ -17,14 +19,13 @@ class TestPaymentsClient;
class AutofillClient;
class AutofillDriver;
class PersonalDataManager;
class TestLocalCardMigrationManager : public LocalCardMigrationManager {
public:
TestLocalCardMigrationManager(AutofillDriver* driver,
AutofillClient* client,
payments::TestPaymentsClient* payments_client,
PersonalDataManager* personal_data_manager);
TestPersonalDataManager* personal_data_manager);
~TestLocalCardMigrationManager() override;
// Override the base function. Checks the existnece of billing customer number
......@@ -50,6 +51,10 @@ class TestLocalCardMigrationManager : public LocalCardMigrationManager {
void OnUserAcceptedMainMigrationDialog(
const std::vector<std::string>& selected_cards) override;
// Mock the Chrome Sync state in the LocalCardMigrationManager. If not set,
// default to AutofillSyncSigninState::kSignedInAndSyncFeature.
void ResetSyncState(AutofillSyncSigninState sync_state);
private:
void OnDidGetUploadDetails(
bool is_from_settings_page,
......@@ -63,6 +68,8 @@ class TestLocalCardMigrationManager : public LocalCardMigrationManager {
bool main_prompt_was_shown_ = false;
TestPersonalDataManager* personal_data_manager_;
DISALLOW_COPY_AND_ASSIGN(TestLocalCardMigrationManager);
};
......
......@@ -19,6 +19,10 @@ void TestPersonalDataManager::OnSyncServiceInitialized(
sync_service_initialized_ = true;
}
AutofillSyncSigninState TestPersonalDataManager::GetSyncSigninState() const {
return sync_and_signin_state_;
}
void TestPersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
CreditCard* credit_card = GetCreditCardWithGUID(data_model.guid().c_str());
if (credit_card)
......
......@@ -28,6 +28,7 @@ class TestPersonalDataManager : public PersonalDataManager {
// for various tests, whether to skip calls to uncreated databases/services,
// or to make things easier in general to toggle.
void OnSyncServiceInitialized(syncer::SyncService* sync_service) override;
AutofillSyncSigninState GetSyncSigninState() const override;
void RecordUseOf(const AutofillDataModel& data_model) override;
std::string SaveImportedProfile(
const AutofillProfile& imported_profile) override;
......@@ -115,6 +116,10 @@ class TestPersonalDataManager : public PersonalDataManager {
void SetSyncFeatureEnabled(bool enabled) { sync_feature_enabled_ = enabled; }
void SetSyncAndSignInState(AutofillSyncSigninState sync_and_signin_state) {
sync_and_signin_state_ = sync_and_signin_state;
}
void SetAccountInfoForPayments(const CoreAccountInfo& account_info) {
account_info_ = account_info;
}
......@@ -129,6 +134,8 @@ class TestPersonalDataManager : public PersonalDataManager {
base::Optional<bool> autofill_credit_card_enabled_;
base::Optional<bool> autofill_wallet_import_enabled_;
bool sync_feature_enabled_ = false;
AutofillSyncSigninState sync_and_signin_state_ =
AutofillSyncSigninState::kSignedInAndSyncFeature;
bool sync_service_initialized_ = false;
CoreAccountInfo account_info_;
......
......@@ -96,6 +96,12 @@ const base::Feature kAutofillEnableCompanyName{
const base::Feature kAutofillEnableIFrameSupportOniOS{
"AutofillEnableIFrameSupportOniOS", base::FEATURE_ENABLED_BY_DEFAULT};
// When enabled, enable local card migration flow for user who has signed in but
// has not turned on sync.
const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser{
"AutofillEnableLocalCardMigrationForNonSyncUser",
base::FEATURE_DISABLED_BY_DEFAULT};
// When enabled, no local copy of server card will be saved when upload
// succeeds.
const base::Feature kAutofillNoLocalSaveOnUploadSuccess{
......
......@@ -39,6 +39,7 @@ extern const base::Feature kAutofillEnableAccountWalletStorage;
extern const base::Feature kAutofillEnableAccountWalletStorageUpload;
extern const base::Feature kAutofillEnableCompanyName;
extern const base::Feature kAutofillEnableIFrameSupportOniOS;
extern const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser;
extern const base::Feature kAutofillEnforceMinRequiredFieldsForHeuristics;
extern const base::Feature kAutofillEnforceMinRequiredFieldsForQuery;
extern const base::Feature kAutofillEnforceMinRequiredFieldsForUpload;
......
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