| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Tests of CancellationFlag class. | 5 // Tests of CancellationFlag class. |
| 6 | 6 |
| 7 #include "base/cancellation_flag.h" | 7 #include "base/cancellation_flag.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/spin_wait.h" | 11 #include "base/spin_wait.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "base/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
| 16 | 16 |
| 17 using base::CancellationFlag; | 17 using base::CancellationFlag; |
| 18 using base::TimeDelta; | 18 using base::TimeDelta; |
| 19 using base::Thread; | 19 using base::Thread; |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 //------------------------------------------------------------------------------ | 23 //------------------------------------------------------------------------------ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest"); | 58 Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest"); |
| 59 ASSERT_TRUE(t.Start()); | 59 ASSERT_TRUE(t.Start()); |
| 60 ASSERT_TRUE(t.message_loop()); | 60 ASSERT_TRUE(t.message_loop()); |
| 61 ASSERT_TRUE(t.IsRunning()); | 61 ASSERT_TRUE(t.IsRunning()); |
| 62 | 62 |
| 63 CancellationFlag flag; | 63 CancellationFlag flag; |
| 64 t.message_loop()->PostTask(FROM_HERE, new CancelTask(&flag)); | 64 t.message_loop()->PostTask(FROM_HERE, new CancelTask(&flag)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| OLD | NEW |