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 #include "base/task_scheduler/task_tracker.h" | 5 #include "base/task_scheduler/task_tracker.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/sequence_token.h" | 17 #include "base/sequence_token.h" |
18 #include "base/sequenced_task_runner.h" | 18 #include "base/sequenced_task_runner.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
21 #include "base/task_scheduler/scheduler_lock.h" | 21 #include "base/task_scheduler/scheduler_lock.h" |
22 #include "base/task_scheduler/sequence.h" | 22 #include "base/task_scheduler/sequence.h" |
23 #include "base/task_scheduler/task.h" | 23 #include "base/task_scheduler/task.h" |
24 #include "base/task_scheduler/task_traits.h" | 24 #include "base/task_scheduler/task_traits.h" |
25 #include "base/task_scheduler/test_utils.h" | 25 #include "base/test/gtest_util.h" |
26 #include "base/test/test_simple_task_runner.h" | 26 #include "base/test/test_simple_task_runner.h" |
27 #include "base/threading/platform_thread.h" | 27 #include "base/threading/platform_thread.h" |
28 #include "base/threading/sequenced_task_runner_handle.h" | 28 #include "base/threading/sequenced_task_runner_handle.h" |
29 #include "base/threading/simple_thread.h" | 29 #include "base/threading/simple_thread.h" |
30 #include "base/threading/thread_restrictions.h" | 30 #include "base/threading/thread_restrictions.h" |
31 #include "base/threading/thread_task_runner_handle.h" | 31 #include "base/threading/thread_task_runner_handle.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 | 33 |
34 namespace base { | 34 namespace base { |
35 namespace internal { | 35 namespace internal { |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 639 |
640 // Unblock shutdown by running |block_shutdown_task|. | 640 // Unblock shutdown by running |block_shutdown_task|. |
641 tracker_.RunNextTaskInSequence( | 641 tracker_.RunNextTaskInSequence( |
642 CreateSequenceWithTask(std::move(block_shutdown_task)).get()); | 642 CreateSequenceWithTask(std::move(block_shutdown_task)).get()); |
643 EXPECT_EQ(kLoadTestNumIterations + 1, NumTasksExecuted()); | 643 EXPECT_EQ(kLoadTestNumIterations + 1, NumTasksExecuted()); |
644 WAIT_FOR_ASYNC_SHUTDOWN_COMPLETED(); | 644 WAIT_FOR_ASYNC_SHUTDOWN_COMPLETED(); |
645 } | 645 } |
646 | 646 |
647 } // namespace internal | 647 } // namespace internal |
648 } // namespace base | 648 } // namespace base |
OLD | NEW |