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

Unified Diff: ui/app_list/views/apps_grid_view_unittest.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « ui/app_list/pagination_model_unittest.cc ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/apps_grid_view_unittest.cc
diff --git a/ui/app_list/views/apps_grid_view_unittest.cc b/ui/app_list/views/apps_grid_view_unittest.cc
index e0b730cd2bbfd484e9ec34b87dc6f197b06cdb4d..ef92052d44eaca639b5982e90f9657a4c37f5339 100644
--- a/ui/app_list/views/apps_grid_view_unittest.cc
+++ b/ui/app_list/views/apps_grid_view_unittest.cc
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -42,8 +42,8 @@ const int kTilesPerPage = kCols * kRows;
class PageFlipWaiter : public PaginationModelObserver {
public:
- PageFlipWaiter(base::MessageLoopForUI* ui_loop, PaginationModel* model)
- : ui_loop_(ui_loop), model_(model), wait_(false) {
+ explicit PageFlipWaiter(PaginationModel* model)
+ : model_(model), wait_(false) {
model_->AddObserver(this);
}
@@ -53,7 +53,8 @@ class PageFlipWaiter : public PaginationModelObserver {
DCHECK(!wait_);
wait_ = true;
- ui_loop_->Run();
+ ui_run_loop_.reset(new base::RunLoop);
+ ui_run_loop_->Run();
wait_ = false;
}
@@ -70,12 +71,12 @@ class PageFlipWaiter : public PaginationModelObserver {
selected_pages_ += base::IntToString(new_selected);
if (wait_)
- ui_loop_->QuitWhenIdle();
+ ui_run_loop_->QuitWhenIdle();
}
void TransitionStarted() override {}
void TransitionChanged() override {}
- base::MessageLoopForUI* ui_loop_;
+ std::unique_ptr<base::RunLoop> ui_run_loop_;
PaginationModel* model_;
bool wait_;
std::string selected_pages_;
@@ -569,7 +570,7 @@ TEST_F(AppsGridViewTest, MouseDragFlipPage) {
test_api_->SetPageFlipDelay(10);
GetPaginationModel()->SetTransitionDurations(10, 10);
- PageFlipWaiter page_flip_waiter(message_loop(), GetPaginationModel());
+ PageFlipWaiter page_flip_waiter(GetPaginationModel());
const int kPages = 3;
model_->PopulateApps(kPages * kTilesPerPage);
« no previous file with comments | « ui/app_list/pagination_model_unittest.cc ('k') | ui/aura/demo/demo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698