Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: sync/internal_api/public/test/fake_sync_manager.h

Issue 10827266: [Sync] Add SyncEncryptionHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "sync/internal_api/public/sync_manager.h" 12 #include "sync/internal_api/public/sync_manager.h"
13 #include "sync/internal_api/public/test/fake_sync_encryption_handler.h"
13 #include "sync/notifier/sync_notifier_helper.h" 14 #include "sync/notifier/sync_notifier_helper.h"
14 15
15 namespace base { 16 namespace base {
16 class SequencedTaskRunner; 17 class SequencedTaskRunner;
17 } 18 }
18 19
19 namespace syncer { 20 namespace syncer {
20 21
21 class FakeSyncManager : public SyncManager { 22 class FakeSyncManager : public SyncManager {
22 public: 23 public:
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( 93 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
93 ModelTypeSet types) OVERRIDE; 94 ModelTypeSet types) OVERRIDE;
94 virtual bool PurgePartiallySyncedTypes() OVERRIDE; 95 virtual bool PurgePartiallySyncedTypes() OVERRIDE;
95 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; 96 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE;
96 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; 97 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE;
97 virtual void UpdateRegisteredInvalidationIds( 98 virtual void UpdateRegisteredInvalidationIds(
98 SyncNotifierObserver* handler, 99 SyncNotifierObserver* handler,
99 const ObjectIdSet& ids) OVERRIDE; 100 const ObjectIdSet& ids) OVERRIDE;
100 virtual void StartSyncingNormally( 101 virtual void StartSyncingNormally(
101 const ModelSafeRoutingInfo& routing_info) OVERRIDE; 102 const ModelSafeRoutingInfo& routing_info) OVERRIDE;
102 virtual void SetEncryptionPassphrase(const std::string& passphrase,
103 bool is_explicit) OVERRIDE;
104 virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE;
105 virtual void ConfigureSyncer( 103 virtual void ConfigureSyncer(
106 ConfigureReason reason, 104 ConfigureReason reason,
107 const ModelTypeSet& types_to_config, 105 const ModelTypeSet& types_to_config,
108 const ModelSafeRoutingInfo& new_routing_info, 106 const ModelSafeRoutingInfo& new_routing_info,
109 const base::Closure& ready_task, 107 const base::Closure& ready_task,
110 const base::Closure& retry_task) OVERRIDE; 108 const base::Closure& retry_task) OVERRIDE;
111 virtual void AddObserver(Observer* observer) OVERRIDE; 109 virtual void AddObserver(Observer* observer) OVERRIDE;
112 virtual void RemoveObserver(Observer* observer) OVERRIDE; 110 virtual void RemoveObserver(Observer* observer) OVERRIDE;
113 virtual SyncStatus GetDetailedStatus() const OVERRIDE; 111 virtual SyncStatus GetDetailedStatus() const OVERRIDE;
114 virtual bool IsUsingExplicitPassphrase() OVERRIDE;
115 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE; 112 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE;
116 virtual void SaveChanges() OVERRIDE; 113 virtual void SaveChanges() OVERRIDE;
117 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; 114 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE;
118 virtual void ShutdownOnSyncThread() OVERRIDE; 115 virtual void ShutdownOnSyncThread() OVERRIDE;
119 virtual UserShare* GetUserShare() OVERRIDE; 116 virtual UserShare* GetUserShare() OVERRIDE;
120 virtual void RefreshNigori(const std::string& chrome_version,
121 const base::Closure& done_callback) OVERRIDE;
122 virtual void EnableEncryptEverything() OVERRIDE;
123 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
124 virtual bool HasUnsyncedItems() OVERRIDE; 117 virtual bool HasUnsyncedItems() OVERRIDE;
118 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE;
125 119
126 private: 120 private:
127 void InvalidateOnSyncThread( 121 void InvalidateOnSyncThread(
128 const ObjectIdPayloadMap& id_payloads, 122 const ObjectIdPayloadMap& id_payloads,
129 IncomingNotificationSource source); 123 IncomingNotificationSource source);
130 void EnableNotificationsOnSyncThread(); 124 void EnableNotificationsOnSyncThread();
131 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); 125 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason);
132 126
133 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; 127 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
134 128
(...skipping 10 matching lines...) Expand all
145 // The set of types that have been cleaned up. 139 // The set of types that have been cleaned up.
146 ModelTypeSet cleaned_types_; 140 ModelTypeSet cleaned_types_;
147 // The set of types that have been downloaded. 141 // The set of types that have been downloaded.
148 ModelTypeSet downloaded_types_; 142 ModelTypeSet downloaded_types_;
149 // The set of types that have been enabled. 143 // The set of types that have been enabled.
150 ModelTypeSet enabled_types_; 144 ModelTypeSet enabled_types_;
151 145
152 // Faked notifier state. 146 // Faked notifier state.
153 SyncNotifierHelper notifier_helper_; 147 SyncNotifierHelper notifier_helper_;
154 148
149 FakeSyncEncryptionHandler fake_encryption_handler_;
150
155 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 151 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
156 }; 152 };
157 153
158 } // namespace syncer 154 } // namespace syncer
159 155
160 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 156 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698