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

Unified Diff: ui/message_center/cocoa/popup_collection_unittest.mm

Issue 2849603003: Use ScopedTaskEnvironment instead of MessageLoopForUI in ui tests. (Closed)
Patch Set: CR-add-newline-after-include 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: ui/message_center/cocoa/popup_collection_unittest.mm
diff --git a/ui/message_center/cocoa/popup_collection_unittest.mm b/ui/message_center/cocoa/popup_collection_unittest.mm
index de85e2c284e3a3293c6cadc0cf9ec30a42eedc82..e5f1abf622669ed79f98925305fada4931a33cd2 100644
--- a/ui/message_center/cocoa/popup_collection_unittest.mm
+++ b/ui/message_center/cocoa/popup_collection_unittest.mm
@@ -8,10 +8,10 @@
#include <utility>
#include "base/mac/scoped_nsobject.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_task_environment.h"
#import "ui/gfx/test/ui_cocoa_test_helper.h"
#import "ui/message_center/cocoa/notification_controller.h"
#import "ui/message_center/cocoa/popup_controller.h"
@@ -25,7 +25,9 @@ namespace message_center {
class PopupCollectionTest : public ui::CocoaTest {
public:
- PopupCollectionTest() {
+ PopupCollectionTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
message_center::MessageCenter::Initialize();
center_ = message_center::MessageCenter::Get();
collection_.reset(
@@ -95,7 +97,7 @@ class PopupCollectionTest : public ui::CocoaTest {
nested_run_loop_.reset();
}
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> nested_run_loop_;
message_center::MessageCenter* center_;
base::scoped_nsobject<MCPopupCollection> collection_;

Powered by Google App Engine
This is Rietveld 408576698