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

Unified Diff: chrome/test/base/view_event_test_base.cc

Issue 8212006: base::Bind: Cleanup in automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac build fix. Created 9 years, 2 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 | « chrome/test/base/view_event_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/view_event_test_base.cc
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc
index f1d3abd22444e42c064be0cbe392ec1a23c0924f..af68770f8d4d710d7b1f182b6a0cb181db5346aa 100644
--- a/chrome/test/base/view_event_test_base.cc
+++ b/chrome/test/base/view_event_test_base.cc
@@ -8,6 +8,8 @@
#include <ole2.h>
#endif
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/string_number_conversions.h"
@@ -70,7 +72,7 @@ void ViewEventTestBase::Done() {
// If we're in a nested message loop, as is the case with menus, we need
// to quit twice. The second quit does that for us.
- MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
+ MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
}
void ViewEventTestBase::SetUp() {
@@ -86,7 +88,7 @@ void ViewEventTestBase::TearDown() {
DestroyWindow(window_->GetNativeWindow());
#else
window_->Close();
- MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
+ MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
ui_test_utils::RunMessageLoop();
#endif
window_ = NULL;
@@ -138,7 +140,7 @@ void ViewEventTestBase::StartMessageLoopAndRunTest() {
// run the message loop.
MessageLoop::current()->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &ViewEventTestBase::DoTestOnMessageLoop));
+ base::Bind(&ViewEventTestBase::DoTestOnMessageLoop, this));
MessageLoop::current()->Run();
}
@@ -153,7 +155,8 @@ void ViewEventTestBase::ScheduleMouseMoveInBackground(int x, int y) {
dnd_thread_->Start();
}
dnd_thread_->message_loop()->PostDelayedTask(
- FROM_HERE, NewRunnableFunction(&ui_controls::SendMouseMove, x, y),
+ FROM_HERE,
+ base::IgnoreReturn<bool>(base::Bind(&ui_controls::SendMouseMove, x, y)),
kMouseMoveDelayMS);
}
@@ -161,11 +164,10 @@ void ViewEventTestBase::StopBackgroundThread() {
dnd_thread_.reset(NULL);
}
-void ViewEventTestBase::RunTestMethod(Task* task) {
+void ViewEventTestBase::RunTestMethod(const base::Closure& task) {
StopBackgroundThread();
- scoped_ptr<Task> task_deleter(task);
- task->Run();
+ task.Run();
if (HasFatalFailure())
Done();
}
« no previous file with comments | « chrome/test/base/view_event_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698