| Index: cc/scheduler/scheduler_unittest.cc
|
| diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
|
| index 9a30c34ba89444efde1add14f2e5c0f94b589ec2..f2046cc886acf1aad8e31500f188348bafe13d12 100644
|
| --- a/cc/scheduler/scheduler_unittest.cc
|
| +++ b/cc/scheduler/scheduler_unittest.cc
|
| @@ -1483,6 +1483,43 @@ TEST_F(SchedulerTest, MainFrameNotSkippedAfterLateCommit_DrawEstimateTooLong) {
|
| CheckMainFrameSkippedAfterLateCommit(expect_send_begin_main_frame));
|
| }
|
|
|
| +// If the BeginMainFrame aborts, it doesn't actually insert a frame into the
|
| +// queue, which means there is no latency to recover.
|
| +TEST_F(SchedulerTest, MainFrameNotSkippedAfterLateAbort) {
|
| + scheduler_settings_.use_external_begin_frame_source = true;
|
| + SetUpScheduler(true);
|
| +
|
| + // Use fast estimates so we think we can recover latency if needed.
|
| + fake_compositor_timing_history_->SetAllEstimatesTo(kFastDuration);
|
| +
|
| + // Impl thread hits deadline before BeginMainFrame aborts.
|
| + scheduler_->SetNeedsBeginMainFrame();
|
| + EXPECT_FALSE(scheduler_->MainThreadMissedLastDeadline());
|
| + EXPECT_SCOPED(AdvanceFrame());
|
| + EXPECT_FALSE(scheduler_->MainThreadMissedLastDeadline());
|
| + task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true));
|
| + EXPECT_TRUE(scheduler_->MainThreadMissedLastDeadline());
|
| + scheduler_->NotifyBeginMainFrameStarted(base::TimeTicks());
|
| + EXPECT_ACTION("SetNeedsBeginFrames(true)", client_, 0, 3);
|
| + EXPECT_ACTION("WillBeginImplFrame", client_, 1, 3);
|
| + EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client_, 2, 3);
|
| + EXPECT_TRUE(scheduler_->MainThreadMissedLastDeadline());
|
| +
|
| + // After aborting the frame, make sure we don't skip the
|
| + // next BeginMainFrame.
|
| + client_->Reset();
|
| + scheduler_->BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
|
| + EXPECT_FALSE(scheduler_->MainThreadMissedLastDeadline());
|
| + scheduler_->SetNeedsBeginMainFrame();
|
| + EXPECT_FALSE(scheduler_->MainThreadMissedLastDeadline());
|
| + EXPECT_SCOPED(AdvanceFrame());
|
| + EXPECT_FALSE(scheduler_->MainThreadMissedLastDeadline());
|
| + task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true));
|
| + EXPECT_TRUE(scheduler_->MainThreadMissedLastDeadline());
|
| + EXPECT_TRUE(client_->HasAction("WillBeginImplFrame"));
|
| + EXPECT_TRUE(client_->HasAction("ScheduledActionSendBeginMainFrame"));
|
| +}
|
| +
|
| void SchedulerTest::ImplFrameSkippedAfterLateSwapAck(
|
| bool swap_ack_before_deadline) {
|
| // To get into a high latency state, this test disables automatic swap acks.
|
|
|