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

Unified Diff: components/sync/driver/async_directory_type_controller_unittest.cc

Issue 2846723005: Use ScopedTaskEnvironment instead of MessageLoopForUI in components tests. (Closed)
Patch Set: fix-test-errors Created 3 years, 8 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
Index: components/sync/driver/async_directory_type_controller_unittest.cc
diff --git a/components/sync/driver/async_directory_type_controller_unittest.cc b/components/sync/driver/async_directory_type_controller_unittest.cc
index c28c2bbad80ce3150135a15e5505d9bebcbcbb2f..fe611899592aa8c0fdd668b1337466b2568b7e00 100644
--- a/components/sync/driver/async_directory_type_controller_unittest.cc
+++ b/components/sync/driver/async_directory_type_controller_unittest.cc
@@ -16,6 +16,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -177,7 +178,10 @@ class AsyncDirectoryTypeControllerFake : public AsyncDirectoryTypeController {
class SyncAsyncDirectoryTypeControllerTest : public testing::Test,
public FakeSyncClient {
public:
- SyncAsyncDirectoryTypeControllerTest() : backend_thread_("dbthread") {}
+ SyncAsyncDirectoryTypeControllerTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ backend_thread_("dbthread") {}
void SetUp() override {
backend_thread_.Start();
@@ -253,7 +257,7 @@ class SyncAsyncDirectoryTypeControllerTest : public testing::Test,
static void SignalDone(WaitableEvent* done) { done->Signal(); }
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
base::Thread backend_thread_;
StartCallbackMock start_callback_;

Powered by Google App Engine
This is Rietveld 408576698