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

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

Issue 12022041: Separate local and remote sync invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 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
« no previous file with comments | « sync/internal_api/public/sync_manager.h ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 // Returns those types that have been downloaded since the last call to 48 // Returns those types that have been downloaded since the last call to
49 // GetAndResetDownloadedTypes(), or since startup if never called. 49 // GetAndResetDownloadedTypes(), or since startup if never called.
50 ModelTypeSet GetAndResetDownloadedTypes(); 50 ModelTypeSet GetAndResetDownloadedTypes();
51 51
52 // Returns those types that have been marked as enabled since the 52 // Returns those types that have been marked as enabled since the
53 // last call to GetAndResetEnabledTypes(), or since startup if never 53 // last call to GetAndResetEnabledTypes(), or since startup if never
54 // called. 54 // called.
55 ModelTypeSet GetAndResetEnabledTypes(); 55 ModelTypeSet GetAndResetEnabledTypes();
56 56
57 // Returns the types that have most recently received a refresh request.
58 ModelTypeSet GetLastRefreshRequestTypes();
59
57 // Posts a method to invalidate the given IDs on the sync thread. 60 // Posts a method to invalidate the given IDs on the sync thread.
58 void Invalidate(const ObjectIdInvalidationMap& invalidation_map, 61 void Invalidate(const ObjectIdInvalidationMap& invalidation_map,
59 IncomingInvalidationSource source); 62 IncomingInvalidationSource source);
60 63
61 // Posts a method to update the invalidator state on the sync thread. 64 // Posts a method to update the invalidator state on the sync thread.
62 void UpdateInvalidatorState(InvalidatorState state); 65 void UpdateInvalidatorState(InvalidatorState state);
63 66
64 // Block until the sync thread has finished processing any pending messages. 67 // Block until the sync thread has finished processing any pending messages.
65 void WaitForSyncThread(); 68 void WaitForSyncThread();
66 69
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual void RemoveObserver(Observer* observer) OVERRIDE; 116 virtual void RemoveObserver(Observer* observer) OVERRIDE;
114 virtual SyncStatus GetDetailedStatus() const OVERRIDE; 117 virtual SyncStatus GetDetailedStatus() const OVERRIDE;
115 virtual void SaveChanges() OVERRIDE; 118 virtual void SaveChanges() OVERRIDE;
116 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; 119 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE;
117 virtual void ShutdownOnSyncThread() OVERRIDE; 120 virtual void ShutdownOnSyncThread() OVERRIDE;
118 virtual UserShare* GetUserShare() OVERRIDE; 121 virtual UserShare* GetUserShare() OVERRIDE;
119 virtual const std::string cache_guid() OVERRIDE; 122 virtual const std::string cache_guid() OVERRIDE;
120 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; 123 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
121 virtual bool HasUnsyncedItems() OVERRIDE; 124 virtual bool HasUnsyncedItems() OVERRIDE;
122 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; 125 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE;
126 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE;
123 127
124 private: 128 private:
125 void InvalidateOnSyncThread( 129 void InvalidateOnSyncThread(
126 const ObjectIdInvalidationMap& invalidation_map, 130 const ObjectIdInvalidationMap& invalidation_map,
127 IncomingInvalidationSource source); 131 IncomingInvalidationSource source);
128 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state); 132 void UpdateInvalidatorStateOnSyncThread(InvalidatorState state);
129 133
130 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; 134 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
131 135
132 ObserverList<SyncManager::Observer> observers_; 136 ObserverList<SyncManager::Observer> observers_;
133 137
134 // Faked directory state. 138 // Faked directory state.
135 ModelTypeSet initial_sync_ended_types_; 139 ModelTypeSet initial_sync_ended_types_;
136 ModelTypeSet progress_marker_types_; 140 ModelTypeSet progress_marker_types_;
137 141
138 // Test specific state. 142 // Test specific state.
139 // The types that should fail configuration attempts. These types will not 143 // The types that should fail configuration attempts. These types will not
140 // have their progress markers or initial_sync_ended bits set. 144 // have their progress markers or initial_sync_ended bits set.
141 ModelTypeSet configure_fail_types_; 145 ModelTypeSet configure_fail_types_;
142 // The set of types that have been cleaned up. 146 // The set of types that have been cleaned up.
143 ModelTypeSet cleaned_types_; 147 ModelTypeSet cleaned_types_;
144 // The set of types that have been downloaded. 148 // The set of types that have been downloaded.
145 ModelTypeSet downloaded_types_; 149 ModelTypeSet downloaded_types_;
146 // The set of types that have been enabled. 150 // The set of types that have been enabled.
147 ModelTypeSet enabled_types_; 151 ModelTypeSet enabled_types_;
148 152
149 // Faked invalidator state. 153 // Faked invalidator state.
150 InvalidatorRegistrar registrar_; 154 InvalidatorRegistrar registrar_;
151 155
156 // The types for which a refresh was most recently requested.
157 ModelTypeSet last_refresh_request_types_;
158
152 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; 159 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_;
153 160
154 TestUserShare test_user_share_; 161 TestUserShare test_user_share_;
155 162
156 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 163 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
157 }; 164 };
158 165
159 } // namespace syncer 166 } // namespace syncer
160 167
161 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 168 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/sync_manager.h ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698