OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ | 5 #ifndef BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ |
6 #define BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ | 6 #define BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <unordered_set> | 10 #include <unordered_set> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/synchronization/condition_variable.h" | 15 #include "base/synchronization/condition_variable.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "base/task_runner.h" | 17 #include "base/task_runner.h" |
18 #include "base/task_scheduler/task_traits.h" | 18 #include "base/task_scheduler/task_traits.h" |
19 #include "base/task_scheduler/test_utils.h" | 19 #include "base/task_scheduler/test_utils.h" |
20 #include "base/threading/thread_checker_impl.h" | 20 #include "base/threading/thread_checker_impl.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 | |
24 class WaitableEvent; | |
25 | |
26 namespace internal { | 23 namespace internal { |
27 namespace test { | 24 namespace test { |
28 | 25 |
29 // A TestTaskFactory posts tasks to a TaskRunner and verifies that they run as | 26 // A TestTaskFactory posts tasks to a TaskRunner and verifies that they run as |
30 // expected. Generates a test failure when: | 27 // expected. Generates a test failure when: |
31 // - The RunsTasksOnCurrentThread() method of the TaskRunner returns false on a | 28 // - The RunsTasksOnCurrentThread() method of the TaskRunner returns false on a |
32 // thread on which a Task is run. | 29 // thread on which a Task is run. |
33 // - The TaskRunnerHandles set in the context of the task don't match what's | 30 // - The TaskRunnerHandles set in the context of the task don't match what's |
34 // expected for the tested ExecutionMode. | 31 // expected for the tested ExecutionMode. |
35 // - The ExecutionMode of the TaskRunner is SEQUENCED or SINGLE_THREADED and | 32 // - The ExecutionMode of the TaskRunner is SEQUENCED or SINGLE_THREADED and |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ThreadCheckerImpl thread_checker_; | 90 ThreadCheckerImpl thread_checker_; |
94 | 91 |
95 DISALLOW_COPY_AND_ASSIGN(TestTaskFactory); | 92 DISALLOW_COPY_AND_ASSIGN(TestTaskFactory); |
96 }; | 93 }; |
97 | 94 |
98 } // namespace test | 95 } // namespace test |
99 } // namespace internal | 96 } // namespace internal |
100 } // namespace base | 97 } // namespace base |
101 | 98 |
102 #endif // BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ | 99 #endif // BASE_TASK_SCHEDULER_TEST_TASK_FACTORY_H_ |
OLD | NEW |