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

Unified Diff: sync/internal_api/sync_context_proxy_impl_unittest.cc

Issue 375023002: sync: Support nudges from non-blocking sync types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 | « sync/engine/syncer_unittest.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_context_proxy_impl_unittest.cc
diff --git a/sync/internal_api/sync_context_proxy_impl_unittest.cc b/sync/internal_api/sync_context_proxy_impl_unittest.cc
index 660670dbd827d3c755d993778f4dde4df3eb2f8b..49ed02de0727c29dba90ceb7b72ea1259fa99c89 100644
--- a/sync/internal_api/sync_context_proxy_impl_unittest.cc
+++ b/sync/internal_api/sync_context_proxy_impl_unittest.cc
@@ -11,6 +11,8 @@
#include "sync/internal_api/public/sync_context.h"
#include "sync/internal_api/sync_context_proxy_impl.h"
#include "sync/sessions/model_type_registry.h"
+#include "sync/test/engine/mock_nudge_handler.h"
+#include "sync/test/engine/test_directory_setter_upper.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
@@ -19,22 +21,39 @@ class SyncContextProxyImplTest : public ::testing::Test {
public:
SyncContextProxyImplTest()
: sync_task_runner_(base::ThreadTaskRunnerHandle::Get()),
- type_task_runner_(base::ThreadTaskRunnerHandle::Get()),
- registry_(new ModelTypeRegistry()),
- context_proxy_(sync_task_runner_, registry_->AsWeakPtr()) {}
+ type_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
+
+ virtual void SetUp() {
+ dir_maker_.SetUp();
+ registry_.reset(new ModelTypeRegistry(
+ workers_, dir_maker_.directory(), &nudge_handler_));
+ context_proxy_.reset(
+ new SyncContextProxyImpl(sync_task_runner_, registry_->AsWeakPtr()));
+ }
+
+ virtual void TearDown() {
+ context_proxy_.reset();
+ registry_.reset();
+ dir_maker_.TearDown();
+ }
// The sync thread could be shut down at any time without warning. This
// function simulates such an event.
void DisableSync() { registry_.reset(); }
- scoped_ptr<SyncContextProxy> GetProxy() { return context_proxy_.Clone(); }
+ scoped_ptr<SyncContextProxy> GetProxy() { return context_proxy_->Clone(); }
private:
base::MessageLoop loop_;
scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
scoped_refptr<base::SequencedTaskRunner> type_task_runner_;
+
+ std::vector<scoped_refptr<ModelSafeWorker> > workers_;
+ TestDirectorySetterUpper dir_maker_;
+ MockNudgeHandler nudge_handler_;
scoped_ptr<ModelTypeRegistry> registry_;
- SyncContextProxyImpl context_proxy_;
+
+ scoped_ptr<SyncContextProxyImpl> context_proxy_;
};
// Try to connect a type to a SyncContext that has already shut down.
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698