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

Unified Diff: components/history/core/browser/history_service_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/history/core/browser/history_service_unittest.cc
diff --git a/components/history/core/browser/history_service_unittest.cc b/components/history/core/browser/history_service_unittest.cc
index b26d83adbbb7ffa3520e601c235939bfcbf65aa9..29ac63f24d02d6b5334858484de3bee2ec1b94ae 100644
--- a/components/history/core/browser/history_service_unittest.cc
+++ b/components/history/core/browser/history_service_unittest.cc
@@ -29,6 +29,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
@@ -51,7 +52,10 @@ namespace history {
class HistoryServiceTest : public testing::Test {
public:
- HistoryServiceTest() : query_url_success_(false) {}
+ HistoryServiceTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ query_url_success_(false) {}
~HistoryServiceTest() override {}
@@ -154,7 +158,7 @@ class HistoryServiceTest : public testing::Test {
base::ScopedTempDir temp_dir_;
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
MostVisitedURLList most_visited_urls_;
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_driver_unittest.cc ('k') | components/history/core/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698