| Index: cc/scheduler/scheduler_state_machine_unittest.cc
|
| diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
|
| index 067f019739b1b385f5f2188806bc849b4ab7f156..64d1c25ec8bdb48e7bf2d5ecb4318b6eb279ab4c 100644
|
| --- a/cc/scheduler/scheduler_state_machine_unittest.cc
|
| +++ b/cc/scheduler/scheduler_state_machine_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "cc/scheduler/scheduler_state_machine.h"
|
|
|
| #include "cc/scheduler/scheduler.h"
|
| +#include "cc/test/begin_frame_args_test.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| #define EXPECT_ACTION_UPDATE_STATE(action) \
|
| @@ -131,7 +132,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_FALSE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -149,7 +150,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_FALSE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| }
|
| @@ -167,7 +168,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -204,7 +205,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeDrawDisabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Commit to the pending tree.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -223,7 +224,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeDrawDisabled) {
|
| // Verify that the next commit doesn't start until the previous
|
| // commit has been drawn.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Make sure that a draw of the active tree doesn't spuriously advance
|
| @@ -240,7 +241,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeDrawDisabled) {
|
|
|
| // Verify NotifyReadyToActivate unblocks activation, draw, and
|
| // commit in that order.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
|
|
| state.NotifyReadyToActivate();
|
| EXPECT_ACTION_UPDATE_STATE(
|
| @@ -287,7 +288,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Commit to the pending tree.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -303,7 +304,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
|
|
|
| // Verify that the next commit starts while there is still a pending tree.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -343,7 +344,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -359,7 +360,7 @@ TEST(SchedulerStateMachineTest,
|
| // Failing the draw makes us require a commit.
|
| state.DidDrawIfPossibleCompleted(
|
| DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -379,7 +380,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawForMissingHighResNeedsCommit) {
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -392,7 +393,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawForMissingHighResNeedsCommit) {
|
| // Missing high res content requires a commit (but not a redraw)
|
| state.DidDrawIfPossibleCompleted(
|
| DrawSwapReadbackResult::DRAW_ABORTED_MISSING_HIGH_RES_CONTENT);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_FALSE(state.RedrawPending());
|
| @@ -412,7 +413,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -432,7 +433,7 @@ TEST(SchedulerStateMachineTest,
|
| // Failing the draw for animation checkerboards makes us require a commit.
|
| state.DidDrawIfPossibleCompleted(
|
| DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -455,7 +456,7 @@ void TestFailedDrawsEventuallyForceDrawAfterNextCommit(
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -486,7 +487,7 @@ void TestFailedDrawsEventuallyForceDrawAfterNextCommit(
|
| EXPECT_TRUE(state.RedrawPending());
|
|
|
| // The redraw should be forced at the end of the next BeginImplFrame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| if (main_frame_before_draw_enabled) {
|
| EXPECT_ACTION_UPDATE_STATE(
|
| @@ -528,7 +529,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) {
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -589,7 +590,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedInNextBeginImplFrame) {
|
| // Start a draw.
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -607,7 +608,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedInNextBeginImplFrame) {
|
|
|
| // We should not be trying to draw again now, but we have a commit pending.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -631,7 +632,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Draw the first frame.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -648,7 +649,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Move to another frame. This should now draw.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -797,7 +798,7 @@ TEST(SchedulerStateMachineTest, TestCanRedraw_StopsDraw) {
|
| state.SetVisible(false);
|
| state.SetNeedsRedraw(true);
|
| if (j == 1)
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
|
|
| state.SetCanDraw(false);
|
| EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE,
|
| @@ -819,7 +820,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| state.SetVisible(true);
|
| state.SetCanDraw(false);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -847,7 +848,7 @@ void TestSetNeedsCommitIsNotLost(bool main_frame_before_draw_enabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -883,7 +884,7 @@ void TestSetNeedsCommitIsNotLost(bool main_frame_before_draw_enabled) {
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
|
| @@ -934,7 +935,7 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -982,7 +983,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -1021,7 +1022,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| EXPECT_FALSE(state.needs_redraw());
|
|
|
| // Next BeginImplFrame should initiate second commit.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1049,7 +1050,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame while visible.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -1079,7 +1080,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| EXPECT_TRUE(state.NeedsCommit());
|
|
|
| // Start a new frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
|
|
| @@ -1118,7 +1119,7 @@ TEST(SchedulerStateMachineTest, AbortBeginMainFrameAndCancelCommit) {
|
|
|
| // Start a new frame; draw because this is the first frame since output
|
| // surface init'd.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1150,14 +1151,14 @@ TEST(SchedulerStateMachineTest, TestFirstContextCreation) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Check that the first init does not SetNeedsCommit.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Check that a needs commit initiates a BeginMainFrame.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1187,7 +1188,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhenCompletelyIdle) {
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
|
|
| // When the context is recreated, we should begin a commit.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1211,14 +1212,14 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Once context recreation begins, nothing should happen.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // While context is recreating, commits shouldn't begin.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1244,7 +1245,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Once the context is recreated, whether we draw should be based on
|
| // SetCanDraw.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1272,7 +1273,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1305,7 +1306,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1337,7 +1338,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1370,7 +1371,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1391,7 +1392,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // After we get a new output surface, the commit flow should start.
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1420,7 +1421,7 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) {
|
|
|
| // Ask a forced redraw for readback and verify it ocurrs.
|
| state.SetNeedsForcedRedrawForReadback();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -1470,7 +1471,7 @@ TEST(SchedulerStateMachineTest, DontDrawBeforeCommitAfterLostOutputSurface) {
|
| state.DidCreateAndInitializeOutputSurface();
|
|
|
| EXPECT_FALSE(state.RedrawPending());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME,
|
| state.NextAction());
|
| }
|
| @@ -1563,7 +1564,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) {
|
| state.NotifyReadyToCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1668,7 +1669,7 @@ void TestForceCommitWhenReplacementActivationInProgress(
|
| }
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| // Perform the draw & swap of replacement commit.
|
| @@ -1708,7 +1709,7 @@ void TestForceCommitWhenReplacementActivationInProgress(
|
| state.NotifyReadyToActivate();
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1758,7 +1759,7 @@ TEST(SchedulerStateMachineTest,
|
| // New commit is requested and scheduled when impl-side painting is in
|
| // progress.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1779,7 +1780,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_FALSE(state.NeedsCommit());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| // Perform the draw & swap of replacement commit.
|
| @@ -2010,7 +2011,7 @@ TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyAfterAbortedCommit) {
|
|
|
| // This test mirrors what happens during the first frame of a scroll gesture.
|
| // First we get the input event and a BeginFrame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
|
|
| // As a response the compositor requests a redraw and a commit to tell the
|
| // main thread about the new scroll offset.
|
| @@ -2044,7 +2045,7 @@ TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyForSmoothness) {
|
|
|
| // This test ensures that impl-draws are prioritized over main thread updates
|
| // in prefer smoothness mode.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| state.SetNeedsRedraw(true);
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| @@ -2073,7 +2074,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.OnBeginImplFrameDeadlinePending();
|
| @@ -2099,7 +2100,7 @@ TEST(SchedulerStateMachineTest, TestAnimateBeforeCommit) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -2126,7 +2127,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimateAfterAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.SetNeedsAnimate();
|
|
|