OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/scheduler/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return CallOnBeginFrame(args); | 204 return CallOnBeginFrame(args); |
205 } | 205 } |
206 | 206 |
207 private: | 207 private: |
208 FakeSchedulerClient* client_; | 208 FakeSchedulerClient* client_; |
209 }; | 209 }; |
210 | 210 |
211 class SchedulerTest : public testing::Test { | 211 class SchedulerTest : public testing::Test { |
212 public: | 212 public: |
213 SchedulerTest() | 213 SchedulerTest() |
214 : now_src_(new base::SimpleTestTickClock()), | 214 : now_src_(new base::SimpleTestTickClock( |
| 215 base::TimeTicks() + base::TimeDelta::FromMicroseconds(1))), |
215 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)), | 216 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)), |
216 fake_external_begin_frame_source_(nullptr) { | 217 fake_external_begin_frame_source_(nullptr) { |
217 now_src_->Advance(base::TimeDelta::FromMicroseconds(10000)); | |
218 // A bunch of tests require NowTicks() | 218 // A bunch of tests require NowTicks() |
219 // to be > BeginFrameArgs::DefaultInterval() | 219 // to be > BeginFrameArgs::DefaultInterval() |
220 now_src_->Advance(base::TimeDelta::FromMilliseconds(100)); | 220 now_src_->Advance(base::TimeDelta::FromMilliseconds(100)); |
221 // Fail if we need to run 100 tasks in a row. | 221 // Fail if we need to run 100 tasks in a row. |
222 task_runner_->SetRunTaskLimit(100); | 222 task_runner_->SetRunTaskLimit(100); |
223 } | 223 } |
224 | 224 |
225 ~SchedulerTest() override {} | 225 ~SchedulerTest() override {} |
226 | 226 |
227 protected: | 227 protected: |
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 scheduler_->SetImplLatencyTakesPriority(true); | 2960 scheduler_->SetImplLatencyTakesPriority(true); |
2961 scheduler_->SetChildrenNeedBeginFrames(true); | 2961 scheduler_->SetChildrenNeedBeginFrames(true); |
2962 | 2962 |
2963 EXPECT_SCOPED(AdvanceFrame()); | 2963 EXPECT_SCOPED(AdvanceFrame()); |
2964 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); | 2964 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); |
2965 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); | 2965 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); |
2966 } | 2966 } |
2967 | 2967 |
2968 } // namespace | 2968 } // namespace |
2969 } // namespace cc | 2969 } // namespace cc |
OLD | NEW |