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

Unified Diff: components/component_updater/timer_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/component_updater/timer_unittest.cc
diff --git a/components/component_updater/timer_unittest.cc b/components/component_updater/timer_unittest.cc
index 2c80e84d2a2acb7ac8d0dcd919844a4acfb629f5..c90ae0251470ce769b2699104112b89c922721a1 100644
--- a/components/component_updater/timer_unittest.cc
+++ b/components/component_updater/timer_unittest.cc
@@ -4,8 +4,8 @@
#include <string>
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "base/time/time.h"
#include "components/component_updater/timer.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -16,11 +16,13 @@ namespace component_updater {
class ComponentUpdaterTimerTest : public testing::Test {
public:
- ComponentUpdaterTimerTest() {}
+ ComponentUpdaterTimerTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
~ComponentUpdaterTimerTest() override {}
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
};
TEST_F(ComponentUpdaterTimerTest, Start) {

Powered by Google App Engine
This is Rietveld 408576698