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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // We can't use EXPECT_GE here as the TimeDelta class does not support the | 236 // We can't use EXPECT_GE here as the TimeDelta class does not support the |
237 // required stream conversion. | 237 // required stream conversion. |
238 EXPECT_TRUE(duration >= kWaitTime); | 238 EXPECT_TRUE(duration >= kWaitTime); |
239 EXPECT_TRUE(duration <= TimeDelta::FromSeconds(kDiscontinuitySeconds)); | 239 EXPECT_TRUE(duration <= TimeDelta::FromSeconds(kDiscontinuitySeconds)); |
240 | 240 |
241 lock.Release(); | 241 lock.Release(); |
242 } | 242 } |
243 #endif | 243 #endif |
244 | 244 |
245 | 245 |
246 // Suddenly got flaky on Win, see http://crbug.com/10607 (starting at | |
247 // comment #15). | |
248 #if defined(OS_WIN) | |
249 #define MAYBE_MultiThreadConsumerTest DISABLED_MultiThreadConsumerTest | |
250 #else | |
251 #define MAYBE_MultiThreadConsumerTest MultiThreadConsumerTest | 246 #define MAYBE_MultiThreadConsumerTest MultiThreadConsumerTest |
252 #endif | |
253 // Test serial task servicing, as well as two parallel task servicing methods. | 247 // Test serial task servicing, as well as two parallel task servicing methods. |
254 TEST_F(ConditionVariableTest, MAYBE_MultiThreadConsumerTest) { | 248 TEST_F(ConditionVariableTest, MAYBE_MultiThreadConsumerTest) { |
255 const int kThreadCount = 10; | 249 const int kThreadCount = 10; |
256 WorkQueue queue(kThreadCount); // Start the threads. | 250 WorkQueue queue(kThreadCount); // Start the threads. |
257 | 251 |
258 const int kTaskCount = 10; // Number of tasks in each mini-test here. | 252 const int kTaskCount = 10; // Number of tasks in each mini-test here. |
259 | 253 |
260 Time start_time; // Used to time task processing. | 254 Time start_time; // Used to time task processing. |
261 | 255 |
262 { | 256 { |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 base::AutoLock auto_lock(lock_); | 750 base::AutoLock auto_lock(lock_); |
757 // Send notification that we completed our "work." | 751 // Send notification that we completed our "work." |
758 WorkIsCompleted(thread_id); | 752 WorkIsCompleted(thread_id); |
759 } | 753 } |
760 } | 754 } |
761 } | 755 } |
762 | 756 |
763 } // namespace | 757 } // namespace |
764 | 758 |
765 } // namespace base | 759 } // namespace base |
OLD | NEW |