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 <stddef.h> |
| 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "build/build_config.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
11 | 14 |
12 namespace base { | 15 namespace base { |
13 | 16 |
14 TEST(WaitableEventTest, ManualBasics) { | 17 TEST(WaitableEventTest, ManualBasics) { |
15 WaitableEvent event(true, false); | 18 WaitableEvent event(true, false); |
16 | 19 |
17 EXPECT_FALSE(event.IsSignaled()); | 20 EXPECT_FALSE(event.IsSignaled()); |
18 | 21 |
19 event.Signal(); | 22 event.Signal(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 PlatformThread::Create(0, &signaler, &thread); | 144 PlatformThread::Create(0, &signaler, &thread); |
142 | 145 |
143 ev->TimedWait(TimeDelta::Max()); | 146 ev->TimedWait(TimeDelta::Max()); |
144 EXPECT_GE(TimeTicks::Now() - start, thread_delay); | 147 EXPECT_GE(TimeTicks::Now() - start, thread_delay); |
145 delete ev; | 148 delete ev; |
146 | 149 |
147 PlatformThread::Join(thread); | 150 PlatformThread::Join(thread); |
148 } | 151 } |
149 | 152 |
150 } // namespace base | 153 } // namespace base |
OLD | NEW |