| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 private: | 250 private: |
| 251 FakeSchedulerClient* client_; | 251 FakeSchedulerClient* client_; |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 class SchedulerTest : public testing::Test { | 254 class SchedulerTest : public testing::Test { |
| 255 public: | 255 public: |
| 256 SchedulerTest() | 256 SchedulerTest() |
| 257 : now_src_(new base::SimpleTestTickClock()), | 257 : now_src_(new base::SimpleTestTickClock()), |
| 258 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)), | 258 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)), |
| 259 fake_external_begin_frame_source_(nullptr) { | 259 fake_external_begin_frame_source_(nullptr) { |
| 260 now_src_->Advance(base::TimeDelta::FromMicroseconds(10000)); | |
| 261 // A bunch of tests require NowTicks() | 260 // A bunch of tests require NowTicks() |
| 262 // to be > BeginFrameArgs::DefaultInterval() | 261 // to be > BeginFrameArgs::DefaultInterval() |
| 263 now_src_->Advance(base::TimeDelta::FromMilliseconds(100)); | 262 now_src_->Advance(base::TimeDelta::FromMilliseconds(100)); |
| 264 // Fail if we need to run 100 tasks in a row. | 263 // Fail if we need to run 100 tasks in a row. |
| 265 task_runner_->SetRunTaskLimit(100); | 264 task_runner_->SetRunTaskLimit(100); |
| 266 } | 265 } |
| 267 | 266 |
| 268 ~SchedulerTest() override {} | 267 ~SchedulerTest() override {} |
| 269 | 268 |
| 270 protected: | 269 protected: |
| (...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3034 scheduler_->SetImplLatencyTakesPriority(true); | 3033 scheduler_->SetImplLatencyTakesPriority(true); |
| 3035 scheduler_->SetChildrenNeedBeginFrames(true); | 3034 scheduler_->SetChildrenNeedBeginFrames(true); |
| 3036 | 3035 |
| 3037 EXPECT_SCOPED(AdvanceFrame()); | 3036 EXPECT_SCOPED(AdvanceFrame()); |
| 3038 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); | 3037 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); |
| 3039 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); | 3038 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); |
| 3040 } | 3039 } |
| 3041 | 3040 |
| 3042 } // namespace | 3041 } // namespace |
| 3043 } // namespace cc | 3042 } // namespace cc |
| OLD | NEW |