| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Counter of the number of "block" workers that have started. | 145 // Counter of the number of "block" workers that have started. |
| 146 size_t started_events_; | 146 size_t started_events_; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 class SequencedWorkerPoolTest : public testing::Test { | 149 class SequencedWorkerPoolTest : public testing::Test { |
| 150 public: | 150 public: |
| 151 SequencedWorkerPoolTest() | 151 SequencedWorkerPoolTest() |
| 152 : pool_owner_(kNumWorkerThreads, "test"), | 152 : pool_owner_(kNumWorkerThreads, "test"), |
| 153 tracker_(new TestTracker) {} | 153 tracker_(new TestTracker) {} |
| 154 | 154 |
| 155 ~SequencedWorkerPoolTest() {} | 155 virtual ~SequencedWorkerPoolTest() {} |
| 156 | 156 |
| 157 virtual void SetUp() {} | 157 virtual void SetUp() OVERRIDE {} |
| 158 | 158 |
| 159 virtual void TearDown() { | 159 virtual void TearDown() OVERRIDE { |
| 160 pool()->Shutdown(); | 160 pool()->Shutdown(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 const scoped_refptr<SequencedWorkerPool>& pool() { | 163 const scoped_refptr<SequencedWorkerPool>& pool() { |
| 164 return pool_owner_.pool(); | 164 return pool_owner_.pool(); |
| 165 } | 165 } |
| 166 TestTracker* tracker() { return tracker_.get(); } | 166 TestTracker* tracker() { return tracker_.get(); } |
| 167 | 167 |
| 168 void SetWillWaitForShutdownCallback(const Closure& callback) { | 168 void SetWillWaitForShutdownCallback(const Closure& callback) { |
| 169 pool_owner_.SetWillWaitForShutdownCallback(callback); | 169 pool_owner_.SetWillWaitForShutdownCallback(callback); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 scoped_ptr<SequencedWorkerPoolOwner> pool_owner_; | 529 scoped_ptr<SequencedWorkerPoolOwner> pool_owner_; |
| 530 }; | 530 }; |
| 531 | 531 |
| 532 INSTANTIATE_TYPED_TEST_CASE_P( | 532 INSTANTIATE_TYPED_TEST_CASE_P( |
| 533 SequencedWorkerPool, TaskRunnerTest, | 533 SequencedWorkerPool, TaskRunnerTest, |
| 534 SequencedWorkerPoolTaskRunnerTestDelegate); | 534 SequencedWorkerPoolTaskRunnerTestDelegate); |
| 535 | 535 |
| 536 } // namespace | 536 } // namespace |
| 537 | 537 |
| 538 } // namespace base | 538 } // namespace base |
| OLD | NEW |