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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 775143003: cc: Implement unified BeginFrame on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unittest 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
Index: cc/scheduler/scheduler_unittest.cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index 50cc846c44114edffbc07dfdc6f0faf117b95299..0bbb74d41ffac15f99012c9ad6f5a998ff1166a6 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -434,7 +434,6 @@ TEST_F(SchedulerTest, InitializeOutputSurfaceDoesNotBeginImplFrame) {
TEST_F(SchedulerTest, SendBeginFramesToChildren) {
scheduler_settings_.use_external_begin_frame_source = true;
- scheduler_settings_.forward_begin_frames_to_children = true;
SetUpScheduler(true);
EXPECT_FALSE(client_->begin_frame_is_sent_to_children());
@@ -455,7 +454,6 @@ TEST_F(SchedulerTest, SendBeginFramesToChildren) {
TEST_F(SchedulerTest, SendBeginFramesToChildrenWithoutCommit) {
scheduler_settings_.use_external_begin_frame_source = true;
- scheduler_settings_.forward_begin_frames_to_children = true;
SetUpScheduler(true);
EXPECT_FALSE(client_->needs_begin_frames());
@@ -530,10 +528,6 @@ TEST_F(SchedulerTest, RequestCommitAfterSetDeferCommit) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- scheduler_->SetCanStart();
- scheduler_->SetVisible(true);
- scheduler_->SetCanDraw(true);
-
scheduler_->SetDeferCommits(true);
scheduler_->SetNeedsCommit();
@@ -566,10 +560,6 @@ TEST_F(SchedulerTest, DeferCommitWithRedraw) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- scheduler_->SetCanStart();
- scheduler_->SetVisible(true);
- scheduler_->SetCanDraw(true);
-
scheduler_->SetDeferCommits(true);
scheduler_->SetNeedsCommit();
@@ -2396,5 +2386,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

Powered by Google App Engine
This is Rietveld 408576698