| 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 // SequencedTaskRunnerTest defines tests that implementations of | 5 // SequencedTaskRunnerTest defines tests that implementations of |
| 6 // SequencedTaskRunner should pass in order to be conformant. | 6 // SequencedTaskRunner should pass in order to be conformant. |
| 7 // See task_runner_test_template.h for a description of how to use the | 7 // See task_runner_test_template.h for a description of how to use the |
| 8 // constructs in this file; these work the same. | 8 // constructs in this file; these work the same. |
| 9 | 9 |
| 10 #ifndef BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ | 10 #ifndef BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // and there is only one instance of each event type for a task. | 111 // and there is only one instance of each event type for a task. |
| 112 // 3) The only events between a task's START and END events are the POSTs of | 112 // 3) The only events between a task's START and END events are the POSTs of |
| 113 // other tasks. I.e. tasks were run sequentially, not interleaved. | 113 // other tasks. I.e. tasks were run sequentially, not interleaved. |
| 114 ::testing::AssertionResult CheckNonNestableInvariants( | 114 ::testing::AssertionResult CheckNonNestableInvariants( |
| 115 const std::vector<TaskEvent>& events, | 115 const std::vector<TaskEvent>& events, |
| 116 int task_count); | 116 int task_count); |
| 117 | 117 |
| 118 } // namespace internal | 118 } // namespace internal |
| 119 | 119 |
| 120 template <typename TaskRunnerTestDelegate> | 120 template <typename TaskRunnerTestDelegate> |
| 121 class SequencedTaskRunnerTest : public testing::Test { | 121 class SequencedTaskRunnerTest : public ::testing::Test { |
| 122 protected: | 122 protected: |
| 123 SequencedTaskRunnerTest() | 123 SequencedTaskRunnerTest() |
| 124 : task_tracker_(new internal::SequencedTaskTracker()) {} | 124 : task_tracker_(new internal::SequencedTaskTracker()) {} |
| 125 | 125 |
| 126 const scoped_refptr<internal::SequencedTaskTracker> task_tracker_; | 126 const scoped_refptr<internal::SequencedTaskTracker> task_tracker_; |
| 127 TaskRunnerTestDelegate delegate_; | 127 TaskRunnerTestDelegate delegate_; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 TYPED_TEST_CASE_P(SequencedTaskRunnerTest); | 130 TYPED_TEST_CASE_P(SequencedTaskRunnerTest); |
| 131 | 131 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 345 } |
| 346 | 346 |
| 347 // SequencedTaskRunnerDelayedTest tests that the |delay| parameter of | 347 // SequencedTaskRunnerDelayedTest tests that the |delay| parameter of |
| 348 // is used to actually wait for |delay| ms before executing the task. | 348 // is used to actually wait for |delay| ms before executing the task. |
| 349 // This is not mandatory for a SequencedTaskRunner to be compliant. | 349 // This is not mandatory for a SequencedTaskRunner to be compliant. |
| 350 REGISTER_TYPED_TEST_CASE_P(SequencedTaskRunnerDelayedTest, DelayedTaskBasic); | 350 REGISTER_TYPED_TEST_CASE_P(SequencedTaskRunnerDelayedTest, DelayedTaskBasic); |
| 351 | 351 |
| 352 } // namespace base | 352 } // namespace base |
| 353 | 353 |
| 354 #endif // BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ | 354 #endif // BASE_TEST_SEQUENCED_TASK_RUNNER_TEST_TEMPLATE_H_ |
| OLD | NEW |