#include <string>
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/test/integration/contact_info_helper.h"
#include "chrome/browser/sync/test/integration/encryption_helper.h"
#include "chrome/browser/sync/test/integration/fake_server_match_status_checker.h"
#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "components/autofill/core/browser/address_data_manager.h"
#include "components/autofill/core/browser/data_model/autofill_profile_test_api.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/webdata/addresses/contact_info_sync_util.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/account_capabilities_test_mutator.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/engine/loopback_server/persistent_unique_client_entity.h"
#include "components/sync/protocol/contact_info_specifics.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/test/fake_server.h"
#include "content/public/test/browser_test.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if !BUILDFLAG(IS_ANDROID)
#include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h"
#endif
namespace {
AutofillProfile;
AddressDataManagerProfileChecker;
BuildTestAccountProfile;
IsEmpty;
UnorderedElementsAre;
#if !BUILDFLAG(IS_ANDROID)
std::string CreateSerializedProtoField(int field_number,
const std::string& value) { … }
MATCHER_P2(HasContactInfoWithGuidAndUnknownFields, guid, unknown_fields, "") { … }
#endif
class ContactInfoActiveChecker : public SingleClientStatusChangeChecker { … };
class FakeServerSpecificsChecker
: public fake_server::FakeServerMatchStatusChecker { … };
sync_pb::ContactInfoSpecifics AsContactInfoSpecifics(
const AutofillProfile& profile) { … }
void AddSpecificsToServer(const sync_pb::ContactInfoSpecifics& specifics,
fake_server::FakeServer* fake_server) { … }
class SingleClientContactInfoSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest, DownloadInitialData) { … }
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest, UploadProfile) { … }
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest, FinalizeAfterImport) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest, ClearOnSignout) { … }
#endif
class SingleClientContactInfoPassphraseSyncTest
: public SingleClientContactInfoSyncTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_Passphrase …
#else
#define MAYBE_Passphrase …
#endif
IN_PROC_BROWSER_TEST_P(SingleClientContactInfoPassphraseSyncTest,
MAYBE_Passphrase) { … }
class SingleClientContactInfoTransportSyncTest
: public SingleClientContactInfoSyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoTransportSyncTest,
TransportMode) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoTransportSyncTest,
DeleteAccountDataInErrorState) { … }
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoTransportSyncTest,
AuthErrorState) { … }
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoTransportSyncTest,
IsAutofillSyncToggleAvailable) { … }
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest,
PreservesUnsupportedFieldsDataOnCommits) { … }
class SingleClientContactInfoManagedAccountTest
: public SingleClientContactInfoSyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientContactInfoManagedAccountTest,
DisabledForManagedAccounts) { … }
class SingleClientContactInfoChildAccountTest
: public SingleClientContactInfoSyncTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(SingleClientContactInfoChildAccountTest,
DisableForChildAccounts) { … }
#endif
}