#include "base/base64.h"
#include "base/feature_list.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/test/integration/committed_all_nudged_changes_checker.h"
#include "chrome/browser/sync/test/integration/encryption_helper.h"
#include "chrome/browser/sync/test/integration/passwords_helper.h"
#include "chrome/browser/sync/test/integration/secondary_account_helper.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/password_manager/core/browser/features/password_features.h"
#include "components/password_manager/core/browser/features/password_manager_features_util.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_manager_test_utils.h"
#include "components/password_manager/core/browser/password_store/password_store_interface.h"
#include "components/password_manager/core/browser/sync/password_sync_bridge.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/base/data_type.h"
#include "components/sync/engine/cycle/entity_change_metric_recording.h"
#include "components/sync/nigori/cryptographer_impl.h"
#include "components/sync/service/sync_service_impl.h"
#include "components/sync/test/fake_server_nigori_helper.h"
#include "components/sync/test/test_matchers.h"
#include "components/version_info/version_info.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_launcher.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/base/features.h"
#include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h"
namespace {
OptInToAccountStorage;
CreateTestPasswordForm;
GetPasswordCount;
GetProfilePasswordStoreInterface;
GetVerifierPasswordCount;
GetVerifierProfilePasswordStoreInterface;
ProfileContainsSamePasswordFormsAsVerifier;
PasswordForm;
Contains;
ElementsAre;
Field;
SizeIs;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
const syncer::SyncFirstSetupCompleteSource kSetSourceFromTest = …;
#endif
MATCHER_P3(HasPasswordValueAndUnsupportedFields,
cryptographer,
password_value,
unknown_fields,
"") { … }
std::string CreateSerializedProtoField(int field_number,
const std::string& value) { … }
class SingleClientPasswordsSyncTest : public SyncTest { … };
class SingleClientPasswordsSyncTestWithVerifier
: public SingleClientPasswordsSyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTestWithVerifier, Sanity) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTestWithVerifier,
CommitWithoutCustomPassphrase) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTestWithVerifier,
CommitWithCustomPassphrase) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTestWithVerifier,
ReencryptsDataWhenPassphraseIsSet) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest,
PRE_PersistProgressMarkerOnRestart) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest,
PersistProgressMarkerOnRestart) { … }
class SingleClientPasswordsWithAccountStorageSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
StoresDataForSyncingPrimaryAccountInProfileDB) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
StoresDataForNonSyncingPrimaryAccountInAccountDB) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
StoresDataForSecondaryAccountInAccountDB) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
DoesNotClearProfileDBOnSignout) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
ClearsAccountDBOnSignout) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
SwitchesStoresOnMakingAccountPrimary) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsWithAccountStorageSyncTest,
EnablesPasswordSyncOnOptingInToSync) { … }
class SingleClientPasswordsWithAccountStorageExplicitSigninSyncTest
: public SingleClientPasswordsWithAccountStorageSyncTest { … };
IN_PROC_BROWSER_TEST_F(
SingleClientPasswordsWithAccountStorageExplicitSigninSyncTest,
PendingState) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientPasswordsWithAccountStorageExplicitSigninSyncTest,
SyncPaused) { … }
#endif
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest,
PreservesUnsupportedFieldsDataOnCommits) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest,
PreservesUnsupportedNotesFieldsDataOnCommits) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest,
ClientReadsNotesFromTheBackup) { … }
IN_PROC_BROWSER_TEST_F(SingleClientPasswordsSyncTest, Delete) { … }
}