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

Unified Diff: chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm

Issue 2851593002: Use ScopedTaskEnvironment instead of MessageLoopForUI in chrome tests. (Closed)
Patch Set: fix-build-error 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: chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm
diff --git a/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm b/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm
index 15ed41cddc45dfb95cb78bdf8f9b94ca4fc9defa..b882ffa31cf4c40841a15d0cb59eb25eb5a3ba11 100644
--- a/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa_unittest.mm
@@ -8,7 +8,7 @@
#include "base/command_line.h"
#include "base/mac/scoped_nsobject.h"
-#include "base/message_loop/message_loop.h"
+#include "base/test/scoped_task_environment.h"
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
#include "chrome/common/chrome_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -34,7 +34,9 @@ namespace {
class AlertIndicatorButtonTest : public CocoaTest {
public:
- AlertIndicatorButtonTest() {
+ AlertIndicatorButtonTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
std::string("--") + switches::kEnableTabAudioMuting);
@@ -82,7 +84,9 @@ class AlertIndicatorButtonTest : public CocoaTest {
}
base::scoped_nsobject<AlertIndicatorButton> button_;
- base::MessageLoopForUI message_loop_; // Needed for gfx::Animation.
+
+ // Needed for gfx::Animation.
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
};
TEST_VIEW(AlertIndicatorButtonTest, button_)

Powered by Google App Engine
This is Rietveld 408576698