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

Unified Diff: chrome/browser/sync/engine/syncer_thread_unittest.cc

Issue 553015: Support for multiple sync ModelSafeWorkers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/engine/syncer_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncer_thread_unittest.cc
===================================================================
--- chrome/browser/sync/engine/syncer_thread_unittest.cc (revision 36603)
+++ chrome/browser/sync/engine/syncer_thread_unittest.cc (working copy)
@@ -26,7 +26,8 @@
typedef testing::Test SyncerThreadTest;
typedef SyncerThread::WaitInterval WaitInterval;
-class SyncerThreadWithSyncerTest : public testing::Test {
+class SyncerThreadWithSyncerTest : public testing::Test,
+ public ModelSafeWorkerRegistrar {
public:
SyncerThreadWithSyncerTest() : sync_cycle_ended_event_(false, false) {}
virtual void SetUp() {
@@ -34,8 +35,9 @@
connection_.reset(new MockConnectionManager(metadb_.manager(),
metadb_.name()));
allstatus_.reset(new AllStatus());
+ worker_.reset(new ModelSafeWorker());
SyncSessionContext* context = new SyncSessionContext(connection_.get(),
- metadb_.manager(), new ModelSafeWorker());
+ metadb_.manager(), this);
syncer_thread_ = new SyncerThread(context, allstatus_.get());
syncer_event_hookup_.reset(
NewEventListenerHookup(syncer_thread_->relay_channel(), this,
@@ -50,6 +52,17 @@
metadb_.TearDown();
}
+ // ModelSafeWorkerRegistrar implementation.
+ virtual void GetWorkers(std::vector<ModelSafeWorker*>* out) {
+ out->push_back(worker_.get());
+ }
+
+ virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) {
+ // We're just testing the sync engine here, so we shunt everything to
+ // the SyncerThread.
+ (*out)[syncable::BOOKMARKS] = GROUP_PASSIVE;
+ }
+
ManuallyOpenedTestDirectorySetterUpper* metadb() { return &metadb_; }
MockConnectionManager* connection() { return connection_.get(); }
SyncerThread* syncer_thread() { return syncer_thread_; }
@@ -72,6 +85,7 @@
scoped_ptr<MockConnectionManager> connection_;
scoped_ptr<AllStatus> allstatus_;
scoped_refptr<SyncerThread> syncer_thread_;
+ scoped_ptr<ModelSafeWorker> worker_;
scoped_ptr<EventListenerHookup> syncer_event_hookup_;
base::WaitableEvent sync_cycle_ended_event_;
DISALLOW_COPY_AND_ASSIGN(SyncerThreadWithSyncerTest);
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/engine/syncer_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698