Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: base/threading/worker_pool_posix_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/threading/watchdog_unittest.cc ('k') | base/threading/worker_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/threading/worker_pool_posix.h" 5 #include "base/threading/worker_pool_posix.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/synchronization/condition_variable.h" 11 #include "base/synchronization/condition_variable.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
14 #include "base/threading/platform_thread.h" 14 #include "base/threading/platform_thread.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/googletest/include/gtest/gtest.h"
16 16
17 namespace base { 17 namespace base {
18 18
19 // Peer class to provide passthrough access to PosixDynamicThreadPool internals. 19 // Peer class to provide passthrough access to PosixDynamicThreadPool internals.
20 class PosixDynamicThreadPool::PosixDynamicThreadPoolPeer { 20 class PosixDynamicThreadPool::PosixDynamicThreadPoolPeer {
21 public: 21 public:
22 explicit PosixDynamicThreadPoolPeer(PosixDynamicThreadPool* pool) 22 explicit PosixDynamicThreadPoolPeer(PosixDynamicThreadPool* pool)
23 : pool_(pool) {} 23 : pool_(pool) {}
24 24
25 Lock* lock() { return &pool_->lock_; } 25 Lock* lock() { return &pool_->lock_; }
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // joined, the next-created thread can get a re-used ID if the allocation of 245 // joined, the next-created thread can get a re-used ID if the allocation of
246 // the pthread_t structure is taken from the free list. Therefore, there can 246 // the pthread_t structure is taken from the free list. Therefore, there can
247 // be either 2 or 3 unique thread IDs in the set at this stage in the test. 247 // be either 2 or 3 unique thread IDs in the set at this stage in the test.
248 EXPECT_TRUE(unique_threads_.size() >= 2 && unique_threads_.size() <= 3) 248 EXPECT_TRUE(unique_threads_.size() >= 2 && unique_threads_.size() <= 3)
249 << "unique_threads_.size() = " << unique_threads_.size(); 249 << "unique_threads_.size() = " << unique_threads_.size();
250 EXPECT_EQ(1, peer_.num_idle_threads()); 250 EXPECT_EQ(1, peer_.num_idle_threads());
251 EXPECT_EQ(4, counter_); 251 EXPECT_EQ(4, counter_);
252 } 252 }
253 253
254 } // namespace base 254 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/watchdog_unittest.cc ('k') | base/threading/worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698