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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: h264_vt_encoder_unittest.cc Created 4 years, 5 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/bookmarks/bookmark_bar_folder_hover_state_unittest.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm
index f31befc3fe46f6af40a79a15cfbc9154776815b5..ee2fc112c1087aa833cafa8d1a517ca80e6fa4f1 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state_unittest.mm
@@ -5,6 +5,8 @@
#import <Cocoa/Cocoa.h>
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_hover_state.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
@@ -45,14 +47,16 @@ TEST_F(BookmarkBarFolderHoverStateTest, HoverState) {
ASSERT_EQ(kHoverStateOpening, [bbfhs hoverState]);
// Test transition from opening to opened.
- message_loop.PostDelayedTask(
- FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure(),
- base::TimeDelta::FromMilliseconds(
- bookmarks::kDragHoverOpenDelay * 1000.0 * 1.5));
- message_loop.Run();
- ASSERT_EQ(kHoverStateOpen, [bbfhs hoverState]);
- ASSERT_EQ(button, [bbfhs hoverButton]);
+ {
+ base::RunLoop run_loop;
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, run_loop.QuitWhenIdleClosure(),
+ base::TimeDelta::FromMilliseconds(bookmarks::kDragHoverOpenDelay *
+ 1000.0 * 1.5));
+ run_loop.Run();
+ ASSERT_EQ(kHoverStateOpen, [bbfhs hoverState]);
+ ASSERT_EQ(button, [bbfhs hoverButton]);
+ }
// Test transition from opening to opened.
[bbfhs scheduleCloseBookmarkFolderOnHoverButton];
@@ -64,16 +68,18 @@ TEST_F(BookmarkBarFolderHoverStateTest, HoverState) {
ASSERT_EQ(button, [bbfhs hoverButton]);
// Test transition from closing to closed.
- [bbfhs scheduleCloseBookmarkFolderOnHoverButton];
- ASSERT_EQ(kHoverStateClosing, [bbfhs hoverState]);
- message_loop.PostDelayedTask(
- FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure(),
- base::TimeDelta::FromMilliseconds(
- bookmarks::kDragHoverCloseDelay * 1000.0 * 1.5));
- message_loop.Run();
- ASSERT_EQ(kHoverStateClosed, [bbfhs hoverState]);
- ASSERT_EQ(nil, [bbfhs hoverButton]);
+ {
+ base::RunLoop run_loop;
+ [bbfhs scheduleCloseBookmarkFolderOnHoverButton];
+ ASSERT_EQ(kHoverStateClosing, [bbfhs hoverState]);
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, run_loop.QuitWhenIdleClosure(),
+ base::TimeDelta::FromMilliseconds(bookmarks::kDragHoverCloseDelay *
+ 1000.0 * 1.5));
+ run_loop.Run();
+ ASSERT_EQ(kHoverStateClosed, [bbfhs hoverState]);
+ ASSERT_EQ(nil, [bbfhs hoverButton]);
+ }
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698