#include "components/sync/test/test_sync_service.h"
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/sync/base/progress_marker_map.h"
#include "components/sync/engine/cycle/model_neutral_state.h"
#include "components/sync/model/type_entities_count.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync/service/sync_token_status.h"
namespace syncer {
namespace {
SyncCycleSnapshot MakeDefaultCycleSnapshot() { … }
CoreAccountInfo GetDefaultAccountInfo() { … }
}
TestSyncService::TestSyncService()
: … { … }
TestSyncService::~TestSyncService() = default;
void TestSyncService::SetSignedIn(signin::ConsentLevel consent_level) { … }
void TestSyncService::SetSignedIn(signin::ConsentLevel consent_level,
const CoreAccountInfo& account_info) { … }
void TestSyncService::SetSignedOut() { … }
void TestSyncService::MimicDashboardClear() { … }
void TestSyncService::SetAllowedByEnterprisePolicy(bool allowed) { … }
void TestSyncService::SetHasUnrecoverableError(bool has_error) { … }
void TestSyncService::SetMaxTransportState(TransportState max_transport_state) { … }
void TestSyncService::SetLocalSyncEnabled(bool local_sync_enabled) { … }
void TestSyncService::SetPersistentAuthError() { … }
void TestSyncService::ClearAuthError() { … }
void TestSyncService::SetInitialSyncFeatureSetupComplete(
bool initial_sync_feature_setup_complete) { … }
void TestSyncService::SetFailedDataTypes(const DataTypeSet& types) { … }
void TestSyncService::SetLastCycleSnapshot(const SyncCycleSnapshot& snapshot) { … }
void TestSyncService::SetEmptyLastCycleSnapshot() { … }
void TestSyncService::SetNonEmptyLastCycleSnapshot() { … }
void TestSyncService::SetDetailedSyncStatus(bool engine_available,
SyncStatus status) { … }
void TestSyncService::SetPassphraseRequired() { … }
void TestSyncService::SetTrustedVaultKeyRequired(bool required) { … }
void TestSyncService::SetTrustedVaultRecoverabilityDegraded(bool degraded) { … }
void TestSyncService::SetIsUsingExplicitPassphrase(bool enabled) { … }
void TestSyncService::SetDownloadStatusFor(
const DataTypeSet& types,
DataTypeDownloadStatus download_status) { … }
void TestSyncService::SetSetupInProgress() { … }
void TestSyncService::FireStateChanged() { … }
void TestSyncService::FireSyncCycleCompleted() { … }
#if BUILDFLAG(IS_ANDROID)
base::android::ScopedJavaLocalRef<jobject> TestSyncService::GetJavaObject() {
return base::android::ScopedJavaLocalRef<jobject>();
}
#endif
void TestSyncService::SetSyncFeatureRequested() { … }
TestSyncUserSettings* TestSyncService::GetUserSettings() { … }
const TestSyncUserSettings* TestSyncService::GetUserSettings() const { … }
SyncService::DisableReasonSet TestSyncService::GetDisableReasons() const { … }
SyncService::TransportState TestSyncService::GetTransportState() const { … }
SyncService::UserActionableError TestSyncService::GetUserActionableError()
const { … }
bool TestSyncService::IsLocalSyncEnabled() const { … }
CoreAccountInfo TestSyncService::GetAccountInfo() const { … }
bool TestSyncService::HasSyncConsent() const { … }
GoogleServiceAuthError TestSyncService::GetAuthError() const { … }
base::Time TestSyncService::GetAuthErrorTime() const { … }
bool TestSyncService::RequiresClientUpgrade() const { … }
std::unique_ptr<SyncSetupInProgressHandle>
TestSyncService::GetSetupInProgressHandle() { … }
bool TestSyncService::IsSetupInProgress() const { … }
DataTypeSet TestSyncService::GetPreferredDataTypes() const { … }
DataTypeSet TestSyncService::GetActiveDataTypes() const { … }
DataTypeSet TestSyncService::GetTypesWithPendingDownloadForInitialSync() const { … }
void TestSyncService::OnDataTypeRequestsSyncStartup(DataType type) { … }
void TestSyncService::TriggerRefresh(const DataTypeSet& types) { … }
void TestSyncService::DataTypePreconditionChanged(DataType type) { … }
void TestSyncService::AddObserver(SyncServiceObserver* observer) { … }
void TestSyncService::RemoveObserver(SyncServiceObserver* observer) { … }
bool TestSyncService::HasObserver(const SyncServiceObserver* observer) const { … }
SyncTokenStatus TestSyncService::GetSyncTokenStatusForDebugging() const { … }
bool TestSyncService::QueryDetailedSyncStatusForDebugging(
SyncStatus* result) const { … }
base::Time TestSyncService::GetLastSyncedTimeForDebugging() const { … }
SyncCycleSnapshot TestSyncService::GetLastCycleSnapshotForDebugging() const { … }
base::Value::List TestSyncService::GetTypeStatusMapForDebugging() const { … }
void TestSyncService::GetEntityCountsForDebugging(
base::RepeatingCallback<void(const TypeEntitiesCount&)> callback) const { … }
const GURL& TestSyncService::GetSyncServiceUrlForDebugging() const { … }
std::string TestSyncService::GetUnrecoverableErrorMessageForDebugging() const { … }
base::Location TestSyncService::GetUnrecoverableErrorLocationForDebugging()
const { … }
void TestSyncService::AddProtocolEventObserver(
ProtocolEventObserver* observer) { … }
void TestSyncService::RemoveProtocolEventObserver(
ProtocolEventObserver* observer) { … }
void TestSyncService::GetAllNodesForDebugging(
base::OnceCallback<void(base::Value::List)> callback) { … }
SyncService::DataTypeDownloadStatus TestSyncService::GetDownloadStatusFor(
DataType type) const { … }
void TestSyncService::SetInvalidationsForSessionsEnabled(bool enabled) { … }
void TestSyncService::SendExplicitPassphraseToPlatformClient() { … }
void TestSyncService::Shutdown() { … }
void TestSyncService::SetTypesWithUnsyncedData(const DataTypeSet& types) { … }
void TestSyncService::GetTypesWithUnsyncedData(
DataTypeSet requested_types,
base::OnceCallback<void(DataTypeSet)> cb) const { … }
void TestSyncService::SetLocalDataDescriptions(
const std::map<DataType, LocalDataDescription>& local_data_descriptions) { … }
void TestSyncService::SetPassphrasePlatformClientCallback(
const base::RepeatingClosure& send_passphrase_to_platform_client_cb) { … }
void TestSyncService::GetLocalDataDescriptions(
DataTypeSet types,
base::OnceCallback<void(std::map<DataType, LocalDataDescription>)>
callback) { … }
void TestSyncService::TriggerLocalDataMigration(DataTypeSet types) { … }
void TestSyncService::SetTriggerRefreshCallback(
const base::RepeatingCallback<void(syncer::DataTypeSet)>&
trigger_refresh_cb) { … }
void TestSyncService::OnSetupInProgressHandleDestroyed() { … }
}