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

Unified Diff: chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell_unittest.mm

Issue 2851593002: Use ScopedTaskEnvironment instead of MessageLoopForUI in chrome tests. (Closed)
Patch Set: self-review 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/toolbar/app_toolbar_button_cell_unittest.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell_unittest.mm b/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell_unittest.mm
index ff6c506688588889cc9b6be10dfcb9cd27d9c1f3..bf7fe122483e9aff952e0e5b4c66caf1b89d7550 100644
--- a/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell_unittest.mm
+++ b/chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell_unittest.mm
@@ -5,7 +5,7 @@
#import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button_cell.h"
#include "base/macros.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"
@interface TestAppToolbarButton : NSButton
@@ -21,7 +21,9 @@
class AppToolbarButtonCellTest : public CocoaTest {
protected:
- AppToolbarButtonCellTest() {
+ AppToolbarButtonCellTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
base::scoped_nsobject<NSButton> button([[TestAppToolbarButton alloc]
initWithFrame:NSMakeRect(0, 0, 29, 29)]);
button_ = button;
@@ -30,7 +32,8 @@ class AppToolbarButtonCellTest : public CocoaTest {
NSButton* button_;
base::scoped_nsobject<AppToolbarButtonCell> cell_;
- base::MessageLoopForUI message_loop_; // Needed for gfx::Animation.
+ base::test::ScopedTaskEnvironment
+ scoped_task_environment_; // Needed for gfx::Animation.
sky 2017/04/27 22:17:46 Move the comment above the member.
fdoray 2017/05/01 17:44:59 Done.
private:
DISALLOW_COPY_AND_ASSIGN(AppToolbarButtonCellTest);

Powered by Google App Engine
This is Rietveld 408576698