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

Side by Side Diff: components/sync_driver/glue/sync_backend_registrar_unittest.cc

Issue 2082333002: Remove calls to deprecated MessageLoop methods in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync_driver/glue/sync_backend_registrar.h" 5 #include "components/sync_driver/glue/sync_backend_registrar.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "components/sync_driver/change_processor_mock.h" 10 #include "components/sync_driver/change_processor_mock.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 sync_thread_ = registrar_->sync_thread(); 113 sync_thread_ = registrar_->sync_thread();
114 } 114 }
115 115
116 void TearDown() override { 116 void TearDown() override {
117 registrar_->RequestWorkerStopOnUIThread(); 117 registrar_->RequestWorkerStopOnUIThread();
118 test_user_share_.TearDown(); 118 test_user_share_.TearDown();
119 sync_thread_->task_runner()->PostTask( 119 sync_thread_->task_runner()->PostTask(
120 FROM_HERE, base::Bind(&SyncBackendRegistrar::Shutdown, 120 FROM_HERE, base::Bind(&SyncBackendRegistrar::Shutdown,
121 base::Unretained(registrar_.release()))); 121 base::Unretained(registrar_.release())));
122 sync_thread_->WaitUntilThreadStarted(); 122 sync_thread_->WaitUntilThreadStarted();
123 sync_thread_->message_loop()->RunUntilIdle(); 123 base::RunLoop().RunUntilIdle();
124 } 124 }
125 125
126 void ExpectRoutingInfo( 126 void ExpectRoutingInfo(
127 SyncBackendRegistrar* registrar, 127 SyncBackendRegistrar* registrar,
128 const syncer::ModelSafeRoutingInfo& expected_routing_info) { 128 const syncer::ModelSafeRoutingInfo& expected_routing_info) {
129 syncer::ModelSafeRoutingInfo routing_info; 129 syncer::ModelSafeRoutingInfo routing_info;
130 registrar->GetModelSafeRoutingInfo(&routing_info); 130 registrar->GetModelSafeRoutingInfo(&routing_info);
131 EXPECT_EQ(expected_routing_info, routing_info); 131 EXPECT_EQ(expected_routing_info, routing_info);
132 } 132 }
133 133
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 sync_thread->task_runner()->PostTask( 449 sync_thread->task_runner()->PostTask(
450 FROM_HERE, base::Bind(&SyncBackendRegistrar::Shutdown, 450 FROM_HERE, base::Bind(&SyncBackendRegistrar::Shutdown,
451 base::Unretained(registrar.release()))); 451 base::Unretained(registrar.release())));
452 452
453 // Make sure the thread starts running. 453 // Make sure the thread starts running.
454 sync_thread->WaitUntilThreadStarted(); 454 sync_thread->WaitUntilThreadStarted();
455 455
456 // The test verifies that the sync thread doesn't block because 456 // The test verifies that the sync thread doesn't block because
457 // of the blocked DB thread and can finish the shutdown. 457 // of the blocked DB thread and can finish the shutdown.
458 sync_thread->message_loop()->RunUntilIdle(); 458 base::RunLoop().RunUntilIdle();
459 459
460 db_thread_lock_.Release(); 460 db_thread_lock_.Release();
461 461
462 // Run the main thread loop until all workers have been removed and the 462 // Run the main thread loop until all workers have been removed and the
463 // registrar destroyed. 463 // registrar destroyed.
464 run_loop_.Run(); 464 run_loop_.Run();
465 } 465 }
466 466
467 } // namespace 467 } // namespace
468 468
469 } // namespace browser_sync 469 } // namespace browser_sync
OLDNEW
« no previous file with comments | « components/sync_driver/glue/sync_backend_host_impl.cc ('k') | components/sync_driver/glue/ui_model_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698