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 // Multi-threaded tests of ConditionVariable class. | 5 // Multi-threaded tests of ConditionVariable class. |
6 | 6 |
7 #include <time.h> | 7 #include <time.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 class ConditionVariableTest : public PlatformTest { | 29 class ConditionVariableTest : public PlatformTest { |
30 public: | 30 public: |
31 const TimeDelta kZeroMs; | 31 const TimeDelta kZeroMs; |
32 const TimeDelta kTenMs; | 32 const TimeDelta kTenMs; |
33 const TimeDelta kThirtyMs; | 33 const TimeDelta kThirtyMs; |
34 const TimeDelta kFortyFiveMs; | 34 const TimeDelta kFortyFiveMs; |
35 const TimeDelta kSixtyMs; | 35 const TimeDelta kSixtyMs; |
36 const TimeDelta kOneHundredMs; | 36 const TimeDelta kOneHundredMs; |
37 | 37 |
38 explicit ConditionVariableTest() | 38 ConditionVariableTest() |
39 : kZeroMs(TimeDelta::FromMilliseconds(0)), | 39 : kZeroMs(TimeDelta::FromMilliseconds(0)), |
40 kTenMs(TimeDelta::FromMilliseconds(10)), | 40 kTenMs(TimeDelta::FromMilliseconds(10)), |
41 kThirtyMs(TimeDelta::FromMilliseconds(30)), | 41 kThirtyMs(TimeDelta::FromMilliseconds(30)), |
42 kFortyFiveMs(TimeDelta::FromMilliseconds(45)), | 42 kFortyFiveMs(TimeDelta::FromMilliseconds(45)), |
43 kSixtyMs(TimeDelta::FromMilliseconds(60)), | 43 kSixtyMs(TimeDelta::FromMilliseconds(60)), |
44 kOneHundredMs(TimeDelta::FromMilliseconds(100)) { | 44 kOneHundredMs(TimeDelta::FromMilliseconds(100)) { |
45 } | 45 } |
46 }; | 46 }; |
47 | 47 |
48 //------------------------------------------------------------------------------ | 48 //------------------------------------------------------------------------------ |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 base::AutoLock auto_lock(lock_); | 706 base::AutoLock auto_lock(lock_); |
707 // Send notification that we completed our "work." | 707 // Send notification that we completed our "work." |
708 WorkIsCompleted(thread_id); | 708 WorkIsCompleted(thread_id); |
709 } | 709 } |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 } // namespace | 713 } // namespace |
714 | 714 |
715 } // namespace base | 715 } // namespace base |
OLD | NEW |