Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1551)

Unified Diff: cc/test/scheduler_test_common.cc

Issue 2158023005: cc: Remove retro frame logic from scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/scheduler/scheduler_state_machine.cc ('K') | « cc/test/scheduler_test_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/scheduler_test_common.cc
diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc
index e9c9f619959f0761133326d0233950c6f12d9909..41cea5bc75575ae019ac252a46dcd6eece039044 100644
--- a/cc/test/scheduler_test_common.cc
+++ b/cc/test/scheduler_test_common.cc
@@ -18,7 +18,9 @@ void FakeDelayBasedTimeSourceClient::OnTimerTick() {
tick_called_ = true;
}
-base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; }
+base::TimeTicks FakeDelayBasedTimeSource::Now() const {
+ return now_;
+}
TestDelayBasedTimeSource::TestDelayBasedTimeSource(
base::SimpleTestTickClock* now_src,
@@ -33,8 +35,7 @@ std::string TestDelayBasedTimeSource::TypeString() const {
return "TestDelayBasedTimeSource";
}
-TestDelayBasedTimeSource::~TestDelayBasedTimeSource() {
-}
+TestDelayBasedTimeSource::~TestDelayBasedTimeSource() {}
std::unique_ptr<FakeCompositorTimingHistory>
FakeCompositorTimingHistory::Create(
@@ -56,8 +57,7 @@ FakeCompositorTimingHistory::FakeCompositorTimingHistory(
rendering_stats_instrumentation_owned_(
std::move(rendering_stats_instrumentation)) {}
-FakeCompositorTimingHistory::~FakeCompositorTimingHistory() {
-}
+FakeCompositorTimingHistory::~FakeCompositorTimingHistory() {}
void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) {
begin_main_frame_queue_duration_critical_ = duration;
@@ -155,13 +155,27 @@ TestScheduler::TestScheduler(
task_runner,
begin_frame_source,
std::move(compositor_timing_history)),
- now_src_(now_src) {}
+ now_src_(now_src),
+ num_begin_frames_(0) {}
base::TimeTicks TestScheduler::Now() const {
return now_src_->NowTicks();
}
-TestScheduler::~TestScheduler() {
+bool TestScheduler::OnBeginFrameDerivedImpl(const BeginFrameArgs& args) {
+ num_begin_frames_++;
+ return Scheduler::OnBeginFrameDerivedImpl(args);
+}
+
+base::Callback<bool(void)> TestScheduler::InCurrentFrame() const {
+ return base::Bind(&TestScheduler::InCurrentFrameCallback,
+ base::Unretained(this), num_begin_frames_);
+}
+
+bool TestScheduler::InCurrentFrameCallback(int num_begin_frames) const {
+ return num_begin_frames_ == num_begin_frames;
}
+TestScheduler::~TestScheduler() {}
+
} // namespace cc
« cc/scheduler/scheduler_state_machine.cc ('K') | « cc/test/scheduler_test_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698