| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/time.h" | |
| 9 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 9 #include "base/time/time.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 | 13 |
| 14 TEST(WaitableEventTest, ManualBasics) { | 14 TEST(WaitableEventTest, ManualBasics) { |
| 15 WaitableEvent event(true, false); | 15 WaitableEvent event(true, false); |
| 16 | 16 |
| 17 EXPECT_FALSE(event.IsSignaled()); | 17 EXPECT_FALSE(event.IsSignaled()); |
| 18 | 18 |
| 19 event.Signal(); | 19 event.Signal(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 EXPECT_EQ(WaitableEvent::WaitMany(ev, 5), 2u); | 100 EXPECT_EQ(WaitableEvent::WaitMany(ev, 5), 2u); |
| 101 | 101 |
| 102 PlatformThread::Join(thread); | 102 PlatformThread::Join(thread); |
| 103 | 103 |
| 104 for (unsigned i = 0; i < 5; ++i) | 104 for (unsigned i = 0; i < 5; ++i) |
| 105 delete ev[i]; | 105 delete ev[i]; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace base | 108 } // namespace base |
| OLD | NEW |