| Index: cc/scheduler/scheduler_unittest.cc
|
| diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
|
| index aa61af73e884bde064647b08281406ca41df2511..0158c20ca132604944df21bc66f4c635d67c7c8d 100644
|
| --- a/cc/scheduler/scheduler_unittest.cc
|
| +++ b/cc/scheduler/scheduler_unittest.cc
|
| @@ -42,40 +42,6 @@ class FakeSchedulerClient;
|
| void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler,
|
| FakeSchedulerClient* client);
|
|
|
| -class TestScheduler : public Scheduler {
|
| - public:
|
| - static scoped_ptr<TestScheduler> Create(
|
| - SchedulerClient* client,
|
| - const SchedulerSettings& scheduler_settings,
|
| - int layer_tree_host_id,
|
| - const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner) {
|
| - return make_scoped_ptr(new TestScheduler(
|
| - client, scheduler_settings, layer_tree_host_id, impl_task_runner));
|
| - }
|
| -
|
| - virtual ~TestScheduler() {}
|
| -
|
| - bool IsBeginRetroFrameArgsEmpty() const {
|
| - return begin_retro_frame_args_.empty();
|
| - }
|
| -
|
| - bool IsSyntheticBeginFrameSourceActive() const {
|
| - return synthetic_begin_frame_source_->IsActive();
|
| - }
|
| -
|
| - private:
|
| - TestScheduler(
|
| - SchedulerClient* client,
|
| - const SchedulerSettings& scheduler_settings,
|
| - int layer_tree_host_id,
|
| - const scoped_refptr<base::SingleThreadTaskRunner> & impl_task_runner)
|
| - : Scheduler(client,
|
| - scheduler_settings,
|
| - layer_tree_host_id,
|
| - impl_task_runner) {
|
| - }
|
| -};
|
| -
|
| class FakeSchedulerClient : public SchedulerClient {
|
| public:
|
| FakeSchedulerClient()
|
| @@ -96,8 +62,7 @@ class FakeSchedulerClient : public SchedulerClient {
|
| }
|
|
|
| TestScheduler* CreateScheduler(const SchedulerSettings& settings) {
|
| - task_runner_ = new OrderedSimpleTaskRunner;
|
| - scheduler_ = TestScheduler::Create(this, settings, 0, task_runner_);
|
| + scheduler_ = TestScheduler::Create(this, settings, 0);
|
| return scheduler_.get();
|
| }
|
|
|
| @@ -115,7 +80,7 @@ class FakeSchedulerClient : public SchedulerClient {
|
| return posted_begin_impl_frame_deadline_;
|
| }
|
|
|
| - OrderedSimpleTaskRunner& task_runner() { return *task_runner_; }
|
| + OrderedSimpleTaskRunner& task_runner() { return scheduler_->task_runner(); }
|
|
|
| int ActionIndex(const char* action) const {
|
| for (size_t i = 0; i < actions_.size(); i++)
|
| @@ -240,7 +205,6 @@ class FakeSchedulerClient : public SchedulerClient {
|
| std::vector<const char*> actions_;
|
| ScopedVector<base::Value> states_;
|
| scoped_ptr<TestScheduler> scheduler_;
|
| - scoped_refptr<OrderedSimpleTaskRunner> task_runner_;
|
| };
|
|
|
| void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler,
|
| @@ -257,7 +221,8 @@ void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler,
|
| scheduler->NotifyReadyToActivate();
|
| // Go through the motions to draw the commit.
|
| if (client_initiates_begin_frame)
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(
|
| + CreateBeginFrameArgsForTesting(client->task_runner()));
|
| else
|
| client->task_runner().RunPendingTasks(); // Run posted BeginFrame.
|
|
|
| @@ -269,7 +234,8 @@ void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler,
|
| // We need another BeginImplFrame so Scheduler calls
|
| // SetNeedsBeginFrame(false).
|
| if (client_initiates_begin_frame)
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(
|
| + CreateBeginFrameArgsForTesting(client->task_runner()));
|
| else
|
| client->task_runner().RunPendingTasks(); // Run posted BeginFrame.
|
|
|
| @@ -311,7 +277,7 @@ TEST(SchedulerTest, RequestCommit) {
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
| client.Reset();
|
|
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -333,7 +299,7 @@ TEST(SchedulerTest, RequestCommit) {
|
| client.Reset();
|
|
|
| // BeginImplFrame should prepare the draw.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -349,7 +315,7 @@ TEST(SchedulerTest, RequestCommit) {
|
|
|
| // The following BeginImplFrame deadline should SetNeedsBeginFrame(false)
|
| // to avoid excessive toggles.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| client.Reset();
|
| @@ -377,7 +343,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -407,7 +373,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
|
| client.Reset();
|
| // Since another commit is needed, the next BeginImplFrame should initiate
|
| // the second commit.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -429,7 +395,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
|
|
|
| // On the next BeginImplFrame, verify we go back to a quiescent state and
|
| // no longer request BeginImplFrames.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_FALSE(client.needs_begin_frame());
|
| client.Reset();
|
| @@ -475,13 +441,13 @@ TEST(SchedulerTest, RequestRedrawInsideDraw) {
|
| EXPECT_TRUE(client.needs_begin_frame());
|
| EXPECT_EQ(0, client.num_draws());
|
|
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(1, client.num_draws());
|
| EXPECT_TRUE(scheduler->RedrawPending());
|
| EXPECT_TRUE(client.needs_begin_frame());
|
|
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| EXPECT_FALSE(scheduler->RedrawPending());
|
| @@ -489,7 +455,7 @@ TEST(SchedulerTest, RequestRedrawInsideDraw) {
|
|
|
| // We stop requesting BeginImplFrames after a BeginImplFrame where we don't
|
| // swap.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| EXPECT_FALSE(scheduler->RedrawPending());
|
| @@ -515,7 +481,7 @@ TEST(SchedulerTest, RequestRedrawInsideFailedDraw) {
|
| EXPECT_EQ(0, client.num_draws());
|
|
|
| // Fail the draw.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(1, client.num_draws());
|
|
|
| @@ -526,7 +492,7 @@ TEST(SchedulerTest, RequestRedrawInsideFailedDraw) {
|
| EXPECT_TRUE(client.needs_begin_frame());
|
|
|
| // Fail the draw again.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| EXPECT_TRUE(scheduler->CommitPending());
|
| @@ -535,7 +501,7 @@ TEST(SchedulerTest, RequestRedrawInsideFailedDraw) {
|
|
|
| // Draw successfully.
|
| client.SetDrawWillHappen(true);
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(3, client.num_draws());
|
| EXPECT_TRUE(scheduler->CommitPending());
|
| @@ -593,7 +559,7 @@ TEST(SchedulerTest, RequestCommitInsideDraw) {
|
| EXPECT_TRUE(client.needs_begin_frame());
|
|
|
| client.SetNeedsCommitOnNextDraw();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.SetNeedsCommitOnNextDraw();
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(1, client.num_draws());
|
| @@ -602,7 +568,7 @@ TEST(SchedulerTest, RequestCommitInsideDraw) {
|
| scheduler->NotifyBeginMainFrameStarted();
|
| scheduler->NotifyReadyToCommit();
|
|
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
|
|
| @@ -612,7 +578,7 @@ TEST(SchedulerTest, RequestCommitInsideDraw) {
|
|
|
| // We stop requesting BeginImplFrames after a BeginImplFrame where we don't
|
| // swap.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| EXPECT_FALSE(scheduler->RedrawPending());
|
| @@ -639,7 +605,7 @@ TEST(SchedulerTest, RequestCommitInsideFailedDraw) {
|
| EXPECT_EQ(0, client.num_draws());
|
|
|
| // Fail the draw.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(1, client.num_draws());
|
|
|
| @@ -650,7 +616,7 @@ TEST(SchedulerTest, RequestCommitInsideFailedDraw) {
|
| EXPECT_TRUE(client.needs_begin_frame());
|
|
|
| // Fail the draw again.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
|
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| @@ -660,7 +626,7 @@ TEST(SchedulerTest, RequestCommitInsideFailedDraw) {
|
|
|
| // Draw successfully.
|
| client.SetDrawWillHappen(true);
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(3, client.num_draws());
|
| EXPECT_TRUE(scheduler->CommitPending());
|
| @@ -685,7 +651,7 @@ TEST(SchedulerTest, NoSwapWhenDrawFails) {
|
|
|
| // Draw successfully, this starts a new frame.
|
| client.SetNeedsCommitOnNextDraw();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(1, client.num_draws());
|
|
|
| @@ -696,7 +662,7 @@ TEST(SchedulerTest, NoSwapWhenDrawFails) {
|
| // Fail to draw, this should not start a frame.
|
| client.SetDrawWillHappen(false);
|
| client.SetNeedsCommitOnNextDraw();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(2, client.num_draws());
|
| }
|
| @@ -735,7 +701,7 @@ TEST(SchedulerTest, ManageTiles) {
|
| // We have no immediate actions to perform, so the BeginImplFrame should post
|
| // the deadline task.
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -763,7 +729,7 @@ TEST(SchedulerTest, ManageTiles) {
|
| // We have no immediate actions to perform, so the BeginImplFrame should post
|
| // the deadline task.
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -784,7 +750,7 @@ TEST(SchedulerTest, ManageTiles) {
|
|
|
| // We need a BeginImplFrame where we don't swap to go idle.
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| client.Reset();
|
| @@ -805,7 +771,7 @@ TEST(SchedulerTest, ManageTiles) {
|
|
|
| // BeginImplFrame. There will be no draw, only ManageTiles.
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| client.Reset();
|
| @@ -831,7 +797,7 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
|
| scheduler->SetNeedsManageTiles();
|
| scheduler->SetNeedsRedraw();
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -853,7 +819,7 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
|
| scheduler->SetNeedsManageTiles();
|
| scheduler->SetNeedsRedraw();
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -876,7 +842,7 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
|
| scheduler->SetNeedsManageTiles();
|
| scheduler->SetNeedsRedraw();
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -899,7 +865,7 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
|
| scheduler->SetNeedsManageTiles();
|
| scheduler->SetNeedsRedraw();
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -918,7 +884,7 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
|
| scheduler->SetNeedsManageTiles();
|
| scheduler->SetNeedsRedraw();
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -954,7 +920,7 @@ TEST(SchedulerTest, ShouldUpdateVisibleTiles) {
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -976,7 +942,7 @@ TEST(SchedulerTest, ShouldUpdateVisibleTiles) {
|
| EXPECT_FALSE(scheduler->RedrawPending());
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
|
|
| @@ -987,7 +953,7 @@ TEST(SchedulerTest, ShouldUpdateVisibleTiles) {
|
| EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 2, 3);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
|
|
| @@ -1009,7 +975,7 @@ TEST(SchedulerTest, TriggerBeginFrameDeadlineEarly) {
|
|
|
| client.Reset();
|
| scheduler->SetNeedsRedraw();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
|
|
| // The deadline should be zero since there is no work other than drawing
|
| // pending.
|
| @@ -1065,7 +1031,7 @@ void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms,
|
| client.Reset();
|
| scheduler->SetNeedsCommit();
|
| EXPECT_FALSE(scheduler->MainThreadIsInHighLatencyMode());
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_FALSE(scheduler->MainThreadIsInHighLatencyMode());
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
|
| @@ -1077,7 +1043,7 @@ void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms,
|
| client.Reset();
|
| scheduler->SetNeedsCommit();
|
| EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
|
| client.task_runner().RunPendingTasks(); // Run posted deadline.
|
| EXPECT_EQ(scheduler->MainThreadIsInHighLatencyMode(),
|
| @@ -1134,7 +1100,8 @@ TEST(SchedulerTest, PollForCommitCompletion) {
|
| scheduler->NotifyReadyToCommit();
|
| scheduler->SetNeedsRedraw();
|
|
|
| - BeginFrameArgs frame_args = CreateBeginFrameArgsForTesting();
|
| + BeginFrameArgs frame_args =
|
| + CreateBeginFrameArgsForTesting(client.task_runner());
|
| frame_args.interval = base::TimeDelta::FromMilliseconds(1000);
|
| scheduler->BeginFrame(frame_args);
|
|
|
| @@ -1166,7 +1133,7 @@ TEST(SchedulerTest, PollForCommitCompletion) {
|
| // Does three iterations to make sure that the timer is properly repeating.
|
| for (int i = 0; i < 3; ++i) {
|
| EXPECT_EQ((frame_args.interval * 2).InMicroseconds(),
|
| - client.task_runner().NextPendingTaskDelay().InMicroseconds())
|
| + client.task_runner().DelayToNextPendingTask().InMicroseconds())
|
| << *scheduler->AsValue();
|
| client.task_runner().RunPendingTasks();
|
| EXPECT_GT(client.num_actions_(), actions_so_far);
|
| @@ -1179,7 +1146,7 @@ TEST(SchedulerTest, PollForCommitCompletion) {
|
| scheduler->NotifyBeginMainFrameStarted();
|
| for (int i = 0; i < 3; ++i) {
|
| EXPECT_EQ((frame_args.interval * 2).InMicroseconds(),
|
| - client.task_runner().NextPendingTaskDelay().InMicroseconds())
|
| + client.task_runner().DelayToNextPendingTask().InMicroseconds())
|
| << *scheduler->AsValue();
|
| client.task_runner().RunPendingTasks();
|
| EXPECT_GT(client.num_actions_(), actions_so_far);
|
| @@ -1207,7 +1174,7 @@ TEST(SchedulerTest, BeginRetroFrame) {
|
|
|
| // Create a BeginFrame with a long deadline to avoid race conditions.
|
| // This is the first BeginFrame, which will be handled immediately.
|
| - BeginFrameArgs args = CreateBeginFrameArgsForTesting();
|
| + BeginFrameArgs args = CreateBeginFrameArgsForTesting(client.task_runner());
|
| args.deadline += base::TimeDelta::FromHours(1);
|
| scheduler->BeginFrame(args);
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| @@ -1286,7 +1253,7 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) {
|
|
|
| // Create a BeginFrame with a long deadline to avoid race conditions.
|
| // This is the first BeginFrame, which will be handled immediately.
|
| - BeginFrameArgs args = CreateBeginFrameArgsForTesting();
|
| + BeginFrameArgs args = CreateBeginFrameArgsForTesting(client.task_runner());
|
| args.deadline += base::TimeDelta::FromHours(1);
|
| scheduler->BeginFrame(args);
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| @@ -1576,7 +1543,7 @@ TEST(SchedulerTest, DidLoseOutputSurfaceAfterBeginFrameStarted) {
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -1615,7 +1582,7 @@ void DidLoseOutputSurfaceAfterBeginFrameStartedWithHighLatency(
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -1632,7 +1599,7 @@ void DidLoseOutputSurfaceAfterBeginFrameStartedWithHighLatency(
|
| EXPECT_NO_ACTION(client);
|
|
|
| // BeginImplFrame is not started.
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_NO_ACTION(client);
|
| EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
|
|
|
| @@ -1678,7 +1645,7 @@ void DidLoseOutputSurfaceAfterReadyToCommit(bool impl_side_painting) {
|
| EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client);
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -1727,7 +1694,7 @@ TEST(SchedulerTest, DidLoseOutputSurfaceAfterSetNeedsManageTiles) {
|
| EXPECT_TRUE(client.needs_begin_frame());
|
|
|
| client.Reset();
|
| - scheduler->BeginFrame(CreateBeginFrameArgsForTesting());
|
| + scheduler->BeginFrame(CreateBeginFrameArgsForTesting(client.task_runner()));
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
|
| EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
|
| @@ -1760,7 +1727,7 @@ TEST(SchedulerTest, DidLoseOutputSurfaceAfterBeginRetroFramePosted) {
|
| // Create a BeginFrame with a long deadline to avoid race conditions.
|
| // This is the first BeginFrame, which will be handled immediately.
|
| client.Reset();
|
| - BeginFrameArgs args = CreateBeginFrameArgsForTesting();
|
| + BeginFrameArgs args = CreateBeginFrameArgsForTesting(client.task_runner());
|
| args.deadline += base::TimeDelta::FromHours(1);
|
| scheduler->BeginFrame(args);
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
| @@ -1819,7 +1786,7 @@ TEST(SchedulerTest, DidLoseOutputSurfaceDuringBeginRetroFrameRunning) {
|
| // Create a BeginFrame with a long deadline to avoid race conditions.
|
| // This is the first BeginFrame, which will be handled immediately.
|
| client.Reset();
|
| - BeginFrameArgs args = CreateBeginFrameArgsForTesting();
|
| + BeginFrameArgs args = CreateBeginFrameArgsForTesting(client.task_runner());
|
| args.deadline += base::TimeDelta::FromHours(1);
|
| scheduler->BeginFrame(args);
|
| EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
|
|
|