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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for task runner instead of current message loop. Created 5 years, 6 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/views/bookmarks/bookmark_bar_view_test.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index d8887c24ed9b9d890d4dffa8d70174181658113f..a7d1b39dc1d196510f1cab99dd78f6f69c9278e3 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -5,9 +5,12 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/location.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_content_browser_client.h"
@@ -315,7 +318,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase {
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
base::RunLoop run_loop;
- loop->PostTask(FROM_HERE, run_loop.QuitClosure());
+ loop->task_runner()->PostTask(FROM_HERE, run_loop.QuitClosure());
msw 2015/06/10 00:12:57 Is this still correct? Should this file include me
Sami 2015/06/10 12:35:34 Yes, MessageLoop::task_runner()->PostTask replaces
run_loop.Run();
ViewEventTestBase::TearDown();
@@ -584,7 +587,7 @@ class BookmarkContextMenuNotificationObserver
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override {
- base::MessageLoop::current()->PostTask(FROM_HERE, task_);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task_);
}
// Sets the task that is posted when the context menu is shown.
@@ -1015,9 +1018,8 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
}
void Step3() {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&BookmarkBarViewTest9::Step4, this),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&BookmarkBarViewTest9::Step4, this),
base::TimeDelta::FromMilliseconds(200));
}
@@ -1032,7 +1034,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
// On linux, Cancelling menu will call Quit on the message loop,
// which can interfere with Done. We need to run Done in the
// next execution loop.
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&ViewEventTestBase::Done, this));
}
@@ -1315,10 +1317,9 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase {
tab_waiter.WaitForTab();
// For some reason return isn't processed correctly unless we delay.
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(
- &BookmarkBarViewTest12::Step5, this, base::Unretained(dialog)),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&BookmarkBarViewTest12::Step5, this,
+ base::Unretained(dialog)),
base::TimeDelta::FromSeconds(1));
}
@@ -1581,7 +1582,7 @@ class BookmarkBarViewTest16 : public BookmarkBarViewEventTestBase {
window_->Close();
window_ = NULL;
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, CreateEventTask(this, &BookmarkBarViewTest16::Done));
}
};

Powered by Google App Engine
This is Rietveld 408576698