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

Unified Diff: components/sync/driver/glue/sync_backend_registrar_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
« no previous file with comments | « components/sync/driver/glue/sync_backend_registrar.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/glue/sync_backend_registrar_unittest.cc
diff --git a/components/sync/driver/glue/sync_backend_registrar_unittest.cc b/components/sync/driver/glue/sync_backend_registrar_unittest.cc
index 9192a4090b8864281d08048e535cd76a51e2b7a2..4723b568cf1ca1c66796976ab34980b274a053a4 100644
--- a/components/sync/driver/glue/sync_backend_registrar_unittest.cc
+++ b/components/sync/driver/glue/sync_backend_registrar_unittest.cc
@@ -80,32 +80,29 @@ class SyncBackendRegistrarTest : public testing::Test {
protected:
SyncBackendRegistrarTest()
- : db_thread_("DBThreadForTest"), file_thread_("FileThreadForTest") {}
+ : db_thread_("DBThreadForTest"),
+ file_thread_("FileThreadForTest"),
+ sync_thread_("SyncThreadForTest") {}
~SyncBackendRegistrarTest() override {}
void SetUp() override {
db_thread_.StartAndWaitForTesting();
file_thread_.StartAndWaitForTesting();
+ sync_thread_.StartAndWaitForTesting();
test_user_share_.SetUp();
sync_client_ = base::MakeUnique<RegistrarSyncClient>(
ui_task_runner(), db_task_runner(), file_task_runner());
registrar_ = base::MakeUnique<SyncBackendRegistrar>(
- "test", sync_client_.get(), std::unique_ptr<base::Thread>(),
- ui_task_runner(), db_task_runner(), file_task_runner());
+ "test", sync_client_.get(), ui_task_runner(), db_task_runner(),
+ file_task_runner());
}
void TearDown() override {
registrar_->RequestWorkerStopOnUIThread();
test_user_share_.TearDown();
- {
- std::unique_ptr<base::Thread> released_sync_thread =
- registrar_->ReleaseSyncThread();
- released_sync_thread->task_runner()->DeleteSoon(FROM_HERE,
- registrar_.release());
- // |released_sync_thread| is joined at the end of this scope.
- }
- base::RunLoop().RunUntilIdle();
+ sync_thread_.task_runner()->DeleteSoon(FROM_HERE, registrar_.release());
+ sync_thread_.FlushForTesting();
}
void ExpectRoutingInfo(SyncBackendRegistrar* registrar,
@@ -145,6 +142,7 @@ class SyncBackendRegistrarTest : public testing::Test {
base::MessageLoop message_loop_;
base::Thread db_thread_;
base::Thread file_thread_;
+ base::Thread sync_thread_;
TestUserShare test_user_share_;
std::unique_ptr<RegistrarSyncClient> sync_client_;
« no previous file with comments | « components/sync/driver/glue/sync_backend_registrar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698