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

Unified Diff: components/bookmarks/browser/bookmark_utils_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/bookmarks/browser/bookmark_utils_unittest.cc
diff --git a/components/bookmarks/browser/bookmark_utils_unittest.cc b/components/bookmarks/browser/bookmark_utils_unittest.cc
index d78e9fcebed4a2deed72f4392fab44c0b6971df1..6f19f5bfbc2016622925ef276960d82ee1ac3ce6 100644
--- a/components/bookmarks/browser/bookmark_utils_unittest.cc
+++ b/components/bookmarks/browser/bookmark_utils_unittest.cc
@@ -10,8 +10,8 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "build/build_config.h"
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
#include "components/bookmarks/browser/bookmark_model.h"
@@ -31,7 +31,10 @@ class BookmarkUtilsTest : public testing::Test,
public BaseBookmarkModelObserver {
public:
BookmarkUtilsTest()
- : grouped_changes_beginning_count_(0), grouped_changes_ended_count_(0) {}
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ grouped_changes_beginning_count_(0),
+ grouped_changes_ended_count_(0) {}
~BookmarkUtilsTest() override {}
@@ -69,12 +72,12 @@ class BookmarkUtilsTest : public testing::Test,
++grouped_changes_ended_count_;
}
+ // Clipboard requires a message loop.
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
+
int grouped_changes_beginning_count_;
int grouped_changes_ended_count_;
- // Clipboard requires a message loop.
- base::MessageLoopForUI loop_;
-
DISALLOW_COPY_AND_ASSIGN(BookmarkUtilsTest);
};
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data_unittest.cc ('k') | components/component_updater/timer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698