#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/encryption_helper.h"
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/common/chrome_paths.h"
#include "components/password_manager/core/browser/features/password_features.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/service/glue/sync_transport_data_prefs.h"
#include "components/sync/service/sync_service_impl.h"
#include "components/sync/test/fake_server_nigori_helper.h"
#include "components/sync/test/nigori_test_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_launcher.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#endif
namespace {
#if !BUILDFLAG(IS_ANDROID)
base::FilePath GetTestFilePathForCacheGuid() { … }
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
class SyncDisabledViaDashboardChecker : public SingleClientStatusChangeChecker {
public:
explicit SyncDisabledViaDashboardChecker(syncer::SyncServiceImpl* service)
: SingleClientStatusChangeChecker(service) {}
bool IsExitConditionSatisfied(std::ostream* os) override {
*os << "Waiting for sync disabled by dashboard";
return service()->GetUserSettings()->IsSyncFeatureDisabledViaDashboard();
}
};
#else
class SyncConsentDisabledChecker : public SingleClientStatusChangeChecker { … };
#endif
class SingleClientStandaloneTransportSyncTest : public SyncTest { … };
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
StartsSyncTransportOnSignin) { … }
#endif
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
SwitchesBetweenTransportAndFeature) { … }
#endif
IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
HandlesResetFromDashboardWhenSyncActive) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
PRE_ReusesSameCacheGuid) { … }
IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest,
ReusesSameCacheGuid) { … }
#endif
class SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest
: public SingleClientStandaloneTransportSyncTest { … };
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest,
DataTypesEnabledInTransportMode) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest,
PRE_DataTypesEnabledInTransportModeWithCustomPassphrase) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest,
DataTypesEnabledInTransportModeWithCustomPassphrase) { … }
#endif
class SingleClientStandaloneTransportWithoutReplaceSyncWithSigninSyncTest
: public SingleClientStandaloneTransportSyncTest { … };
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportWithoutReplaceSyncWithSigninSyncTest,
DataTypesNotEnabledInTransportMode) { … }
#if !BUILDFLAG(IS_ANDROID)
class SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest
: public SingleClientStandaloneTransportSyncTest { … };
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest,
PRE_MigratesSignedInUser) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest,
MigratesSignedInUser) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest,
PRE_MigratesSignedInCustomPassphraseUser) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest,
MigratesSignedInCustomPassphraseUser) { … }
#endif
}