| 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
|
|
|