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(sync_driver::SyncServiceObserver
* observer
) override
;
26 void RemoveObserver(sync_driver::SyncServiceObserver
* observer
) override
;
28 const sync_driver::SyncServiceObserver
* observer
) const override
;
29 bool IsSyncEnabledAndLoggedIn() override
;
30 void DisableForUser() override
;
31 void RequestStop() 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 bool IsPassphraseRequiredForDecryption() const override
;
45 base::Time
GetExplicitPassphraseTime() const override
;
46 bool IsUsingSecondaryPassphrase() const override
;
47 void EnableEncryptEverything() override
;
48 void SetEncryptionPassphrase(const std::string
& passphrase
,
49 PassphraseType type
) override
;
50 bool SetDecryptionPassphrase(const std::string
& passphrase
) override
;
52 // sync_driver::DataTypeEncryptionHandler:
53 bool IsPassphraseRequired() const override
;
54 syncer::ModelTypeSet
GetEncryptedDataTypes() const override
;
56 GoogleServiceAuthError error_
;
59 } // namespace sync_driver
61 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_