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

Unified Diff: components/sync/device_info/device_info_data_type_controller_unittest.cc

Issue 2846723005: Use ScopedTaskEnvironment instead of MessageLoopForUI in components tests. (Closed)
Patch Set: self-review 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/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_;

Powered by Google App Engine
This is Rietveld 408576698