OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/scheduler/task_queue_manager.h" | 5 #include "content/renderer/scheduler/task_queue_manager.h" |
6 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "cc/test/test_now_source.h" | 9 #include "cc/test/test_now_source.h" |
10 #include "content/renderer/scheduler/task_queue_selector.h" | 10 #include "content/renderer/scheduler/task_queue_selector.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 void AppendQueueToService(size_t queue_index) { | 35 void AppendQueueToService(size_t queue_index) { |
36 queues_to_service_.push_back(queue_index); | 36 queues_to_service_.push_back(queue_index); |
37 } | 37 } |
38 | 38 |
39 const std::vector<const base::TaskQueue*>& work_queues() { | 39 const std::vector<const base::TaskQueue*>& work_queues() { |
40 return work_queues_; | 40 return work_queues_; |
41 } | 41 } |
42 | 42 |
43 void AsValueInto(base::debug::TracedValue* state) const override { | 43 void AsValueInto(base::trace_event::TracedValue* state) const override { |
44 } | 44 } |
45 | 45 |
46 private: | 46 private: |
47 std::deque<size_t> queues_to_service_; | 47 std::deque<size_t> queues_to_service_; |
48 std::vector<const base::TaskQueue*> work_queues_; | 48 std::vector<const base::TaskQueue*> work_queues_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(SelectorForTest); | 50 DISALLOW_COPY_AND_ASSIGN(SelectorForTest); |
51 }; | 51 }; |
52 | 52 |
53 class TaskQueueManagerTest : public testing::Test { | 53 class TaskQueueManagerTest : public testing::Test { |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 test_task_runner_->RunPendingTasks(); | 577 test_task_runner_->RunPendingTasks(); |
578 EXPECT_THAT(run_order, ElementsAre(2)); | 578 EXPECT_THAT(run_order, ElementsAre(2)); |
579 | 579 |
580 // Running all remaining tasks should execute both pending tasks. | 580 // Running all remaining tasks should execute both pending tasks. |
581 test_task_runner_->RunUntilIdle(); | 581 test_task_runner_->RunUntilIdle(); |
582 EXPECT_THAT(run_order, ElementsAre(2, 3, 1)); | 582 EXPECT_THAT(run_order, ElementsAre(2, 3, 1)); |
583 } | 583 } |
584 | 584 |
585 } // namespace | 585 } // namespace |
586 } // namespace content | 586 } // namespace content |
OLD | NEW |