| Index: cc/scheduler/scheduler_unittest.cc
|
| diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
|
| index 37fa8e0a6c9b56e3503b55ec3327822d5e37a8c0..d515648bdb476bfd0417e739a7e55ec769c517c1 100644
|
| --- a/cc/scheduler/scheduler_unittest.cc
|
| +++ b/cc/scheduler/scheduler_unittest.cc
|
| @@ -3042,120 +3042,6 @@ TEST_F(SchedulerTest, ScheduledActionActivateAfterBeginFrameSourcePaused) {
|
| EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client_);
|
| }
|
|
|
| -// Tests to ensure frame sources can be successfully changed while drawing.
|
| -TEST_F(SchedulerTest, SwitchFrameSourceToUnthrottled) {
|
| - scheduler_settings_.use_external_begin_frame_source = true;
|
| - SetUpScheduler(true);
|
| -
|
| - // SetNeedsRedraw should begin the frame on the next BeginImplFrame.
|
| - scheduler_->SetNeedsRedraw();
|
| - EXPECT_SINGLE_ACTION("AddObserver(this)", client_);
|
| - client_->Reset();
|
| -
|
| - EXPECT_SCOPED(AdvanceFrame());
|
| - EXPECT_ACTION("WillBeginImplFrame", client_, 0, 1);
|
| - EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
|
| - EXPECT_TRUE(scheduler_->begin_frames_expected());
|
| - client_->Reset();
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1);
|
| - scheduler_->SetNeedsRedraw();
|
| -
|
| - // Switch to an unthrottled frame source.
|
| - scheduler_->SetThrottleFrameProduction(false);
|
| - client_->Reset();
|
| -
|
| - // Unthrottled frame source will immediately begin a new frame.
|
| - task_runner().RunPendingTasks(); // Run posted BeginFrame.
|
| - EXPECT_ACTION("WillBeginImplFrame", client_, 0, 1);
|
| - EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
|
| - client_->Reset();
|
| -
|
| - // If we don't swap on the deadline, we wait for the next BeginFrame.
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1);
|
| - EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
|
| - client_->Reset();
|
| -}
|
| -
|
| -// Tests to ensure frame sources can be successfully changed while a frame
|
| -// deadline is pending.
|
| -TEST_F(SchedulerTest, SwitchFrameSourceToUnthrottledBeforeDeadline) {
|
| - scheduler_settings_.use_external_begin_frame_source = true;
|
| - SetUpScheduler(true);
|
| -
|
| - // SetNeedsRedraw should begin the frame on the next BeginImplFrame.
|
| - scheduler_->SetNeedsRedraw();
|
| - EXPECT_SINGLE_ACTION("AddObserver(this)", client_);
|
| - client_->Reset();
|
| -
|
| - EXPECT_SCOPED(AdvanceFrame());
|
| - EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
|
| -
|
| - // Switch to an unthrottled frame source before the frame deadline is hit.
|
| - scheduler_->SetThrottleFrameProduction(false);
|
| - client_->Reset();
|
| -
|
| - EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
|
| - EXPECT_TRUE(scheduler_->begin_frames_expected());
|
| - client_->Reset();
|
| -
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client_);
|
| - client_->Reset();
|
| -
|
| - // Unthrottled frame source will immediately begin a new frame.
|
| - task_runner().RunPendingTasks(); // Run BeginFrame.
|
| - EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
|
| - scheduler_->SetNeedsRedraw();
|
| - client_->Reset();
|
| -
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client_);
|
| - EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
|
| - client_->Reset();
|
| -}
|
| -
|
| -// Tests to ensure that the active frame source can successfully be changed from
|
| -// unthrottled to throttled.
|
| -TEST_F(SchedulerTest, SwitchFrameSourceToThrottled) {
|
| - scheduler_settings_.throttle_frame_production = false;
|
| - scheduler_settings_.use_external_begin_frame_source = true;
|
| - SetUpScheduler(true);
|
| -
|
| - scheduler_->SetNeedsRedraw();
|
| - EXPECT_NO_ACTION(client_);
|
| - client_->Reset();
|
| -
|
| - task_runner().RunPendingTasks(); // Run posted BeginFrame.
|
| - EXPECT_ACTION("WillBeginImplFrame", client_, 0, 1);
|
| - EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
|
| - client_->Reset();
|
| -
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1);
|
| - EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
|
| - client_->Reset();
|
| -
|
| - // Switch to a throttled frame source.
|
| - scheduler_->SetThrottleFrameProduction(true);
|
| - client_->Reset();
|
| -
|
| - // SetNeedsRedraw should begin the frame on the next BeginImplFrame.
|
| - scheduler_->SetNeedsRedraw();
|
| - task_runner().RunPendingTasks();
|
| - EXPECT_NO_ACTION(client_);
|
| - client_->Reset();
|
| -
|
| - EXPECT_SCOPED(AdvanceFrame());
|
| - EXPECT_ACTION("WillBeginImplFrame", client_, 0, 1);
|
| - EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
|
| - EXPECT_TRUE(scheduler_->begin_frames_expected());
|
| - client_->Reset();
|
| - task_runner().RunPendingTasks(); // Run posted deadline.
|
| - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1);
|
| -}
|
| -
|
| // Tests to ensure that we send a BeginMainFrameNotExpectedSoon when expected.
|
| TEST_F(SchedulerTest, SendBeginMainFrameNotExpectedSoon) {
|
| scheduler_settings_.use_external_begin_frame_source = true;
|
|
|