| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "platform/scheduler/child/idle_canceled_delayed_task_sweeper.h" | 5 #include "platform/scheduler/child/idle_canceled_delayed_task_sweeper.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "cc/test/ordered_simple_task_runner.h" | 9 #include "cc/test/ordered_simple_task_runner.h" |
| 10 #include "public/platform/scheduler/base/task_queue.h" | |
| 11 #include "platform/scheduler/base/lazy_now.h" | 10 #include "platform/scheduler/base/lazy_now.h" |
| 12 #include "platform/scheduler/base/test_time_source.h" | 11 #include "platform/scheduler/base/test_time_source.h" |
| 13 #include "platform/scheduler/child/idle_helper.h" | 12 #include "platform/scheduler/child/idle_helper.h" |
| 14 #include "platform/scheduler/child/scheduler_helper.h" | 13 #include "platform/scheduler/child/scheduler_helper.h" |
| 15 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h" | 14 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h" |
| 15 #include "public/platform/scheduler/base/task_queue.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 namespace scheduler { | 19 namespace scheduler { |
| 20 | 20 |
| 21 class TestClass { | 21 class TestClass { |
| 22 public: | 22 public: |
| 23 TestClass() : weak_factory_(this) {} | 23 TestClass() : weak_factory_(this) {} |
| 24 | 24 |
| 25 void NopTask() {} | 25 void NopTask() {} |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // canceled tasks would get removed by TaskQueueImpl::WakeUpForDelayedWork. | 128 // canceled tasks would get removed by TaskQueueImpl::WakeUpForDelayedWork. |
| 129 clock_->Advance(base::TimeDelta::FromSeconds(40)); | 129 clock_->Advance(base::TimeDelta::FromSeconds(40)); |
| 130 idle_helper_->EnableLongIdlePeriod(); | 130 idle_helper_->EnableLongIdlePeriod(); |
| 131 mock_task_runner_->RunForPeriod(base::TimeDelta::FromSeconds(40)); | 131 mock_task_runner_->RunForPeriod(base::TimeDelta::FromSeconds(40)); |
| 132 | 132 |
| 133 EXPECT_EQ(1u, default_task_runner_->GetNumberOfPendingTasks()); | 133 EXPECT_EQ(1u, default_task_runner_->GetNumberOfPendingTasks()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace scheduler | 136 } // namespace scheduler |
| 137 } // namespace blink | 137 } // namespace blink |
| OLD | NEW |