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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 1005553004: cc: Add support for handling authoritative vsync interval (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/test/fake_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_unittest.cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index b59359c03f29bd13bfa2d5f4063ff5d9b295c206..dacc03ce21ae118e553ad78b10324a5e45a3d9e9 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -2272,5 +2272,33 @@ TEST_F(SchedulerTest, SendBeginMainFrameNotExpectedSoon) {
client_->Reset();
}
+TEST_F(SchedulerTest, AuthoritativeVSyncInterval) {
+ SetUpScheduler(true);
+
+ base::TimeDelta initial_interval =
+ scheduler_->begin_impl_frame_args().interval;
+ base::TimeDelta authoritative_interval =
+ base::TimeDelta::FromMilliseconds(33);
+
+ scheduler_->SetNeedsCommit();
+ EXPECT_SCOPED(AdvanceFrame());
+
+ EXPECT_EQ(initial_interval, scheduler_->begin_impl_frame_args().interval);
+
+ scheduler_->NotifyBeginMainFrameStarted();
+ scheduler_->NotifyReadyToCommit();
+ task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true));
+
+ scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval);
+
+ EXPECT_SCOPED(AdvanceFrame());
+
+ // At the next BeginFrame, authoritative interval is used instead of previous
+ // interval.
+ EXPECT_NE(initial_interval, scheduler_->begin_impl_frame_args().interval);
+ EXPECT_EQ(authoritative_interval,
+ scheduler_->begin_impl_frame_args().interval);
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/test/fake_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698