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

Unified Diff: components/sync/driver/generic_change_processor_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/generic_change_processor_unittest.cc
diff --git a/components/sync/driver/generic_change_processor_unittest.cc b/components/sync/driver/generic_change_processor_unittest.cc
index 1bc4628e767f9cd7e67294b0b2803eb3de466795..41d53b1d5269cf5f67d7017b94765b95c9473d55 100644
--- a/components/sync/driver/generic_change_processor_unittest.cc
+++ b/components/sync/driver/generic_change_processor_unittest.cc
@@ -9,9 +9,9 @@
#include <utility>
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
+#include "base/test/scoped_task_environment.h"
#include "components/sync/base/model_type.h"
#include "components/sync/device_info/local_device_info_provider.h"
#include "components/sync/driver/fake_sync_client.h"
@@ -123,7 +123,9 @@ class SyncGenericChangeProcessorTest : public testing::Test {
static const ModelType kType = PREFERENCES;
SyncGenericChangeProcessorTest()
- : syncable_service_ptr_factory_(&fake_syncable_service_),
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ syncable_service_ptr_factory_(&fake_syncable_service_),
mock_attachment_service_(nullptr),
sync_client_(&sync_factory_) {}
@@ -193,7 +195,7 @@ class SyncGenericChangeProcessorTest : public testing::Test {
}
private:
- base::MessageLoopForUI loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<SyncMergeResult> sync_merge_result_;
std::unique_ptr<base::WeakPtrFactory<SyncMergeResult>>
« no previous file with comments | « components/sync/driver/async_directory_type_controller_unittest.cc ('k') | components/sync_sessions/favicon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698