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

Unified Diff: components/sync/driver/glue/sync_backend_host_impl_unittest.cc

Issue 2481313002: [Sync] Move sync thread ownership to ProfileSyncService. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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
Index: components/sync/driver/glue/sync_backend_host_impl_unittest.cc
diff --git a/components/sync/driver/glue/sync_backend_host_impl_unittest.cc b/components/sync/driver/glue/sync_backend_host_impl_unittest.cc
index 935e79fc95ff2514ca670e1be70cb74116743330..56c75fe0a1dbab7b652032152ecee0f07390cbd7 100644
--- a/components/sync/driver/glue/sync_backend_host_impl_unittest.cc
+++ b/components/sync/driver/glue/sync_backend_host_impl_unittest.cc
@@ -154,7 +154,8 @@ class BackendSyncClient : public FakeSyncClient {
class SyncBackendHostTest : public testing::Test {
protected:
- SyncBackendHostTest() : fake_manager_(nullptr) {}
+ SyncBackendHostTest()
+ : sync_thread_("SyncThreadForTest"), fake_manager_(nullptr) {}
~SyncBackendHostTest() override {}
@@ -164,6 +165,7 @@ class SyncBackendHostTest : public testing::Test {
SyncPrefs::RegisterProfilePrefs(pref_service_.registry());
sync_prefs_ = base::MakeUnique<SyncPrefs>(&pref_service_);
+ sync_thread_.StartAndWaitForTesting();
backend_ = base::MakeUnique<SyncBackendHostImpl>(
"dummyDebugName", &sync_client_, base::ThreadTaskRunnerHandle::Get(),
nullptr, sync_prefs_->AsWeakPtr(),
@@ -211,8 +213,7 @@ class SyncBackendHostTest : public testing::Test {
base::Unretained(network_resources_.get()), nullptr,
base::Bind(&EmptyNetworkTimeUpdate));
backend_->Initialize(
- &mock_frontend_, std::unique_ptr<base::Thread>(),
- base::ThreadTaskRunnerHandle::Get(),
+ &mock_frontend_, &sync_thread_, base::ThreadTaskRunnerHandle::Get(),
base::ThreadTaskRunnerHandle::Get(), WeakHandle<JsEventHandler>(),
GURL(std::string()), std::string(), credentials_, true, false,
base::FilePath(), std::move(fake_manager_factory_),
@@ -267,6 +268,7 @@ class SyncBackendHostTest : public testing::Test {
base::MessageLoop message_loop_;
base::ScopedTempDir temp_dir_;
sync_preferences::TestingPrefServiceSyncable pref_service_;
+ base::Thread sync_thread_;
StrictMock<MockSyncFrontend> mock_frontend_;
SyncCredentials credentials_;
BackendSyncClient sync_client_;
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_impl.cc ('k') | components/sync/driver/glue/sync_backend_host_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698