OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/scheduler/base/time_domain.h" | 5 #include "components/scheduler/base/time_domain.h" |
6 | 6 |
7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
8 #include "cc/test/ordered_simple_task_runner.h" | 8 #include "cc/test/ordered_simple_task_runner.h" |
9 #include "components/scheduler/base/task_queue_impl.h" | 9 #include "components/scheduler/base/task_queue_impl.h" |
10 #include "components/scheduler/base/task_queue_manager.h" | 10 #include "components/scheduler/base/task_queue_manager.h" |
11 #include "components/scheduler/base/task_queue_manager_delegate_for_test.h" | 11 #include "components/scheduler/base/task_queue_manager_delegate_for_test.h" |
12 #include "components/scheduler/base/test_time_source.h" | 12 #include "components/scheduler/base/test_time_source.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 | 14 |
15 using testing::_; | 15 using testing::_; |
16 using testing::Mock; | 16 using testing::Mock; |
17 | 17 |
18 namespace scheduler { | 18 namespace scheduler { |
19 | 19 |
20 class MockTimeDomain : public TimeDomain { | 20 class MockTimeDomain : public TimeDomain { |
21 public: | 21 public: |
22 MockTimeDomain() | 22 MockTimeDomain() |
23 : now_(base::TimeTicks() + base::TimeDelta::FromSeconds(1)) {} | 23 : TimeDomain(nullptr), |
| 24 now_(base::TimeTicks() + base::TimeDelta::FromSeconds(1)) {} |
24 | 25 |
25 using TimeDomain::NextScheduledRunTime; | 26 using TimeDomain::NextScheduledRunTime; |
26 using TimeDomain::NextScheduledTaskQueue; | 27 using TimeDomain::NextScheduledTaskQueue; |
27 using TimeDomain::ScheduleDelayedWork; | 28 using TimeDomain::ScheduleDelayedWork; |
28 using TimeDomain::UnregisterQueue; | 29 using TimeDomain::UnregisterQueue; |
29 using TimeDomain::UpdateWorkQueues; | 30 using TimeDomain::UpdateWorkQueues; |
30 | 31 |
31 // TimeSource implementation: | 32 // TimeSource implementation: |
32 LazyNow CreateLazyNow() override { return LazyNow(now_); } | 33 LazyNow CreateLazyNow() override { return LazyNow(now_); } |
33 | 34 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 171 |
171 time_domain_->UpdateWorkQueues(false, nullptr); | 172 time_domain_->UpdateWorkQueues(false, nullptr); |
172 EXPECT_EQ(0UL, dummy_queue->IncomingQueueSizeForTest()); | 173 EXPECT_EQ(0UL, dummy_queue->IncomingQueueSizeForTest()); |
173 | 174 |
174 time_domain_->SetNow(delayed_runtime); | 175 time_domain_->SetNow(delayed_runtime); |
175 time_domain_->UpdateWorkQueues(false, nullptr); | 176 time_domain_->UpdateWorkQueues(false, nullptr); |
176 EXPECT_EQ(1UL, dummy_queue->IncomingQueueSizeForTest()); | 177 EXPECT_EQ(1UL, dummy_queue->IncomingQueueSizeForTest()); |
177 } | 178 } |
178 | 179 |
179 } // namespace scheduler | 180 } // namespace scheduler |
OLD | NEW |