| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 private: | 49 private: |
| 50 SequenceChecker sequence_checker_; | 50 SequenceChecker sequence_checker_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(SequenceCheckedObject); | 52 DISALLOW_COPY_AND_ASSIGN(SequenceCheckedObject); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class SequenceCheckerTest : public testing::Test { | 55 class SequenceCheckerTest : public testing::Test { |
| 56 public: | 56 public: |
| 57 SequenceCheckerTest() : other_thread_("sequence_checker_test_other_thread") {} | 57 SequenceCheckerTest() : other_thread_("sequence_checker_test_other_thread") {} |
| 58 | 58 |
| 59 virtual ~SequenceCheckerTest() {} | 59 void SetUp() override { |
| 60 | |
| 61 virtual void SetUp() override { | |
| 62 other_thread_.Start(); | 60 other_thread_.Start(); |
| 63 ResetPool(); | 61 ResetPool(); |
| 64 } | 62 } |
| 65 | 63 |
| 66 virtual void TearDown() override { | 64 void TearDown() override { |
| 67 other_thread_.Stop(); | 65 other_thread_.Stop(); |
| 68 pool()->Shutdown(); | 66 pool()->Shutdown(); |
| 69 } | 67 } |
| 70 | 68 |
| 71 protected: | 69 protected: |
| 72 base::Thread* other_thread() { return &other_thread_; } | 70 base::Thread* other_thread() { return &other_thread_; } |
| 73 | 71 |
| 74 const scoped_refptr<SequencedWorkerPool>& pool() { | 72 const scoped_refptr<SequencedWorkerPool>& pool() { |
| 75 return pool_owner_->pool(); | 73 return pool_owner_->pool(); |
| 76 } | 74 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 #endif // ENABLE_SEQUENCE_CHECKER | 325 #endif // ENABLE_SEQUENCE_CHECKER |
| 328 | 326 |
| 329 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_SEQUENCE_CHECKER | 327 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_SEQUENCE_CHECKER |
| 330 | 328 |
| 331 } // namespace | 329 } // namespace |
| 332 | 330 |
| 333 } // namespace base | 331 } // namespace base |
| 334 | 332 |
| 335 // Just in case we ever get lumped together with other compilation units. | 333 // Just in case we ever get lumped together with other compilation units. |
| 336 #undef ENABLE_SEQUENCE_CHECKER | 334 #undef ENABLE_SEQUENCE_CHECKER |
| OLD | NEW |