Index: components/sync/device_info/device_info_data_type_controller_unittest.cc |
diff --git a/components/sync/device_info/device_info_data_type_controller_unittest.cc b/components/sync/device_info/device_info_data_type_controller_unittest.cc |
index 27c572f20ec7102e44e9bb3685135b2e7da8c1f3..23924697226db89ca0aa9cbfe1b7c43fc7ffeb8a 100644 |
--- a/components/sync/device_info/device_info_data_type_controller_unittest.cc |
+++ b/components/sync/device_info/device_info_data_type_controller_unittest.cc |
@@ -9,6 +9,7 @@ |
#include "base/memory/ptr_util.h" |
#include "base/memory/weak_ptr.h" |
#include "base/run_loop.h" |
+#include "base/test/scoped_task_environment.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "components/sync/base/model_type.h" |
#include "components/sync/device_info/local_device_info_provider_mock.h" |
@@ -23,7 +24,9 @@ namespace { |
class DeviceInfoDataTypeControllerTest : public testing::Test { |
public: |
DeviceInfoDataTypeControllerTest() |
- : load_finished_(false), |
+ : scoped_task_environment_( |
+ base::test::ScopedTaskEnvironment::MainThreadType::UI), |
+ load_finished_(false), |
last_type_(UNSPECIFIED), |
weak_ptr_factory_(this) {} |
~DeviceInfoDataTypeControllerTest() override {} |
@@ -84,7 +87,7 @@ class DeviceInfoDataTypeControllerTest : public testing::Test { |
bool load_finished_; |
private: |
- base::MessageLoopForUI message_loop_; |
+ base::test::ScopedTaskEnvironment scoped_task_environment_; |
ModelType last_type_; |
SyncError last_error_; |
FakeSyncClient sync_client_; |