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

Unified Diff: base/synchronization/cancellation_flag_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 | « no previous file | base/synchronization/waitable_event_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/cancellation_flag_unittest.cc
diff --git a/base/synchronization/cancellation_flag_unittest.cc b/base/synchronization/cancellation_flag_unittest.cc
index e4b58303e10cffacbbc4c10592aa90b9875baf72..9a845de5d749dba550beabff58e37202ec88050f 100644
--- a/base/synchronization/cancellation_flag_unittest.cc
+++ b/base/synchronization/cancellation_flag_unittest.cc
@@ -6,6 +6,7 @@
#include "base/synchronization/cancellation_flag.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/spin_wait.h"
@@ -22,17 +23,11 @@ namespace {
// Define our test class.
//------------------------------------------------------------------------------
-class CancelTask : public Task {
- public:
- explicit CancelTask(CancellationFlag* flag) : flag_(flag) {}
- virtual void Run() {
+void CancelHelper(CancellationFlag* flag) {
#if GTEST_HAS_DEATH_TEST
- ASSERT_DEBUG_DEATH(flag_->Set(), "");
+ ASSERT_DEBUG_DEATH(flag->Set(), "");
#endif
- }
- private:
- CancellationFlag* flag_;
-};
+}
TEST(CancellationFlagTest, SimpleSingleThreadedTest) {
CancellationFlag flag;
@@ -61,7 +56,7 @@ TEST(CancellationFlagTest, SetOnDifferentThreadDeathTest) {
ASSERT_TRUE(t.IsRunning());
CancellationFlag flag;
- t.message_loop()->PostTask(FROM_HERE, new CancelTask(&flag));
+ t.message_loop()->PostTask(FROM_HERE, base::Bind(&CancelHelper, &flag));
}
} // namespace
« no previous file with comments | « no previous file | base/synchronization/waitable_event_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698