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

Unified Diff: chrome/browser/sync/engine/syncer_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/syncer_types.h ('k') | chrome/browser/sync/engine/syncer_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncer_unittest.cc
===================================================================
--- chrome/browser/sync/engine/syncer_unittest.cc (revision 36603)
+++ chrome/browser/sync/engine/syncer_unittest.cc (working copy)
@@ -96,7 +96,9 @@
const int64 kTestLogRequestTimestamp = 123456;
} // namespace
-class SyncerTest : public testing::Test, public SyncSession::Delegate {
+class SyncerTest : public testing::Test,
+ public SyncSession::Delegate,
+ public ModelSafeWorkerRegistrar {
protected:
SyncerTest() : syncer_(NULL) {}
@@ -116,6 +118,17 @@
last_short_poll_interval_received_ = new_interval;
}
+ // 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;
+ }
+
void HandleSyncerEvent(SyncerEvent event) {
LOG(INFO) << "HandleSyncerEvent in unittest " << event.what_happened;
// we only test for entry-specific events, not status changed ones.
@@ -151,9 +164,9 @@
mock_server_.reset(
new MockConnectionManager(syncdb_.manager(), syncdb_.name()));
-
+ worker_.reset(new ModelSafeWorker());
context_.reset(new SyncSessionContext(mock_server_.get(), syncdb_.manager(),
- new ModelSafeWorker()));
+ this));
context_->set_account_name(syncdb_.name());
ASSERT_FALSE(context_->syncer_event_channel());
ASSERT_FALSE(context_->resolver());
@@ -364,6 +377,7 @@
std::set<SyncerEvent> syncer_events_;
base::TimeDelta last_short_poll_interval_received_;
base::TimeDelta last_long_poll_interval_received_;
+ scoped_ptr<ModelSafeWorker> worker_;
DISALLOW_COPY_AND_ASSIGN(SyncerTest);
};
« no previous file with comments | « chrome/browser/sync/engine/syncer_types.h ('k') | chrome/browser/sync/engine/syncer_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698