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

Unified Diff: base/threading/worker_pool_unittest.cc

Issue 8653006: Remove custom Task implementations in base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 | « base/threading/thread_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_unittest.cc
diff --git a/base/threading/worker_pool_unittest.cc b/base/threading/worker_pool_unittest.cc
index cd20f478044fdc42c2e89020a34cc0722c54d6e8..d36cb1bab5833468e700b26ab10016c7e4b7e4b1 100644
--- a/base/threading/worker_pool_unittest.cc
+++ b/base/threading/worker_pool_unittest.cc
@@ -5,6 +5,7 @@
#include "base/threading/worker_pool.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/location.h"
#include "base/message_loop.h"
#include "base/task.h"
@@ -21,19 +22,6 @@ namespace base {
namespace {
-class PostTaskTestTask : public Task {
- public:
- explicit PostTaskTestTask(WaitableEvent* event) : event_(event) {
- }
-
- void Run() {
- event_->Signal();
- }
-
- private:
- WaitableEvent* event_;
-};
-
class PostTaskAndReplyTester
: public base::RefCountedThreadSafe<PostTaskAndReplyTester> {
public:
@@ -81,8 +69,14 @@ TEST_F(WorkerPoolTest, PostTask) {
WaitableEvent test_event(false, false);
WaitableEvent long_test_event(false, false);
- WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&test_event), false);
- WorkerPool::PostTask(FROM_HERE, new PostTaskTestTask(&long_test_event), true);
+ WorkerPool::PostTask(FROM_HERE,
+ base::Bind(&WaitableEvent::Signal,
+ base::Unretained(&test_event)),
+ false);
+ WorkerPool::PostTask(FROM_HERE,
+ base::Bind(&WaitableEvent::Signal,
+ base::Unretained(&long_test_event)),
+ true);
test_event.Wait();
long_test_event.Wait();
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698