1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_
6 #define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_
8 #include "components/sync_driver/sync_service.h"
9 #include "google_apis/gaia/google_service_auth_error.h"
11 namespace sync_driver
{
13 // Fake implementation of sync_driver::SyncService, used for testing.
14 class FakeSyncService
: public sync_driver::SyncService
{
17 ~FakeSyncService() override
;
20 // sync_driver::SyncService:
21 bool HasSyncSetupCompleted() const override
;
22 bool IsSyncAllowed() const override
;
23 bool IsSyncActive() const override
;
24 syncer::ModelTypeSet
GetActiveDataTypes() const override
;
25 void AddObserver(SyncServiceObserver
* observer
) override
;
26 void RemoveObserver(SyncServiceObserver
* observer
) override
;
27 bool HasObserver(const SyncServiceObserver
* observer
) const override
;
28 void OnDataTypeRequestsSyncStartup(syncer::ModelType type
) override
;
29 bool CanSyncStart() const override
;
31 sync_driver::SyncService::SyncStopDataFate data_fate
) override
;
32 void RequestStart() override
;
33 syncer::ModelTypeSet
GetPreferredDataTypes() const override
;
34 void OnUserChoseDatatypes(bool sync_everything
,
35 syncer::ModelTypeSet chosen_types
) override
;
36 void SetSyncSetupCompleted() override
;
37 bool FirstSetupInProgress() const override
;
38 void SetSetupInProgress(bool setup_in_progress
) override
;
39 bool setup_in_progress() const override
;
40 bool ConfigurationDone() const override
;
41 const GoogleServiceAuthError
& GetAuthError() const override
;
42 bool HasUnrecoverableError() const override
;
43 bool backend_initialized() const override
;
44 OpenTabsUIDelegate
* GetOpenTabsUIDelegate() override
;
45 bool IsPassphraseRequiredForDecryption() const override
;
46 base::Time
GetExplicitPassphraseTime() const override
;
47 bool IsUsingSecondaryPassphrase() const override
;
48 void EnableEncryptEverything() override
;
49 void SetEncryptionPassphrase(const std::string
& passphrase
,
50 PassphraseType type
) override
;
51 bool SetDecryptionPassphrase(const std::string
& passphrase
) override
;
53 // DataTypeEncryptionHandler:
54 bool IsPassphraseRequired() const override
;
55 syncer::ModelTypeSet
GetEncryptedDataTypes() const override
;
57 GoogleServiceAuthError error_
;
60 } // namespace sync_driver
62 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_