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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on 1415763008; existing tests pass; new tests needed Created 5 years, 1 month 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 6bdf5dd3eb678db3bd44c11236b5356e31c650b9..fa255cbcc7a11f841ad49d865bc8b6e8c7644e1b 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -485,8 +485,9 @@ TEST_F(SchedulerTest, SendBeginFramesToChildrenDeadlineNotAdjusted) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- fake_compositor_timing_history_->SetBeginMainFrameToCommitDurationEstimate(
- base::TimeDelta::FromMilliseconds(2));
+ fake_compositor_timing_history_
+ ->SetBeginMainFrameStartToCommitDurationEstimate(
+ base::TimeDelta::FromMilliseconds(2));
fake_compositor_timing_history_->SetCommitToReadyToActivateDurationEstimate(
base::TimeDelta::FromMilliseconds(4));
fake_compositor_timing_history_->SetDrawDurationEstimate(
@@ -1401,7 +1402,7 @@ TEST_F(SchedulerTest,
MainFrameNotSkippedAfterLateCommitInPreferImplLatencyMode) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- scheduler_->SetImplLatencyTakesPriority(true);
+ scheduler_->SetSmoothnessMode(true, false);
auto fast_duration = base::TimeDelta::FromMilliseconds(1);
fake_compositor_timing_history_->SetAllEstimatesTo(fast_duration);
@@ -1418,8 +1419,8 @@ TEST_F(SchedulerTest,
auto fast_duration = base::TimeDelta::FromMilliseconds(1);
fake_compositor_timing_history_->SetAllEstimatesTo(fast_duration);
auto slow_duration = base::TimeDelta::FromSeconds(1);
- fake_compositor_timing_history_->SetBeginMainFrameToCommitDurationEstimate(
- slow_duration);
+ fake_compositor_timing_history_
+ ->SetBeginMainFrameStartToCommitDurationEstimate(slow_duration);
bool expect_send_begin_main_frame = true;
EXPECT_SCOPED(
@@ -1578,7 +1579,7 @@ TEST_F(SchedulerTest,
// Even if every estimate related to the main thread is slow, we should
// still expect to recover impl thread latency if the draw is fast and we
// are in impl latency takes priority.
- scheduler_->SetImplLatencyTakesPriority(true);
+ scheduler_->SetSmoothnessMode(true, false);
auto slow_duration = base::TimeDelta::FromSeconds(1);
fake_compositor_timing_history_->SetAllEstimatesTo(slow_duration);
auto fast_duration = base::TimeDelta::FromMilliseconds(1);
@@ -1718,8 +1719,8 @@ TEST_F(SchedulerTest,
auto fast_duration = base::TimeDelta::FromMilliseconds(1);
fake_compositor_timing_history_->SetAllEstimatesTo(fast_duration);
auto slow_duration = base::TimeDelta::FromSeconds(1);
- fake_compositor_timing_history_->SetBeginMainFrameToCommitDurationEstimate(
- slow_duration);
+ fake_compositor_timing_history_
+ ->SetBeginMainFrameStartToCommitDurationEstimate(slow_duration);
EXPECT_SCOPED(ImplFrameIsNotSkippedAfterLateSwapAck());
}
@@ -3486,10 +3487,10 @@ TEST_F(SchedulerTest, AuthoritativeVSyncInterval) {
TEST_F(SchedulerTest, ImplLatencyTakesPriority) {
SetUpScheduler(true);
- scheduler_->SetImplLatencyTakesPriority(true);
+ scheduler_->SetSmoothnessMode(true, false);
EXPECT_TRUE(scheduler_->ImplLatencyTakesPriority());
- scheduler_->SetImplLatencyTakesPriority(false);
+ scheduler_->SetSmoothnessMode(false, false);
EXPECT_FALSE(scheduler_->ImplLatencyTakesPriority());
}
@@ -3497,7 +3498,7 @@ TEST_F(SchedulerTest, BeginMainFrameArgs_OnCriticalPath) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- scheduler_->SetImplLatencyTakesPriority(false);
+ scheduler_->SetSmoothnessMode(false, false);
scheduler_->SetNeedsBeginMainFrame();
client_->Reset();
@@ -3511,7 +3512,7 @@ TEST_F(SchedulerTest, BeginMainFrameArgs_NotOnCriticalPath) {
scheduler_settings_.use_external_begin_frame_source = true;
SetUpScheduler(true);
- scheduler_->SetImplLatencyTakesPriority(true);
+ scheduler_->SetSmoothnessMode(true, false);
scheduler_->SetNeedsBeginMainFrame();
client_->Reset();

Powered by Google App Engine
This is Rietveld 408576698