| 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 85160ed1c482f5e0cd89cc881e542d06f3312a69..e76eded5693665f6a0a39295f0beef5a12427845 100644
|
| --- a/cc/scheduler/scheduler_state_machine_unittest.cc
|
| +++ b/cc/scheduler/scheduler_state_machine_unittest.cc
|
| @@ -122,7 +122,8 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_FALSE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(
|
| + CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -140,7 +141,8 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_FALSE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(
|
| + CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| }
|
| @@ -158,7 +160,8 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
|
|
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(
|
| + CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -195,7 +198,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Commit to the pending tree.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -211,7 +214,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
|
|
|
| // Verify that the next commit starts while there is still a pending tree.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -252,7 +255,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -269,7 +272,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Failing the draw makes us require a commit.
|
| state.DidDrawIfPossibleCompleted(DRAW_ABORTED_CHECKERBOARD_ANIMATIONS);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -289,7 +292,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawForMissingHighResNeedsCommit) {
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -303,7 +306,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawForMissingHighResNeedsCommit) {
|
|
|
| // Missing high res content requires a commit (but not a redraw)
|
| state.DidDrawIfPossibleCompleted(DRAW_ABORTED_MISSING_HIGH_RES_CONTENT);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_FALSE(state.RedrawPending());
|
| @@ -323,7 +326,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -344,7 +347,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Failing the draw for animation checkerboards makes us require a commit.
|
| state.DidDrawIfPossibleCompleted(DRAW_ABORTED_CHECKERBOARD_ANIMATIONS);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -365,7 +368,7 @@ TEST(SchedulerStateMachineTest,
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -395,7 +398,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_TRUE(state.RedrawPending());
|
|
|
| // The redraw should be forced at the end of the next BeginImplFrame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -423,7 +426,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) {
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -480,7 +483,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedInNextBeginImplFrame) {
|
| // Start a draw.
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -497,7 +500,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(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -523,7 +526,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Draw the first frame.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -542,7 +545,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Move to another frame. This should now draw.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -680,7 +683,8 @@ TEST(SchedulerStateMachineTest, TestCanRedraw_StopsDraw) {
|
| state.SetVisible(false);
|
| state.SetNeedsRedraw(true);
|
| if (j == 1)
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(
|
| + CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
|
|
| state.SetCanDraw(false);
|
| EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE,
|
| @@ -702,7 +706,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| state.SetVisible(true);
|
| state.SetCanDraw(false);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| @@ -730,7 +734,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -766,7 +770,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) {
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
|
| @@ -803,7 +807,7 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -853,7 +857,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -894,7 +898,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| EXPECT_FALSE(state.needs_redraw());
|
|
|
| // Next BeginImplFrame should initiate second commit.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -922,7 +926,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame while visible.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -952,7 +956,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| EXPECT_TRUE(state.NeedsCommit());
|
|
|
| // Start a new frame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
|
|
| @@ -991,7 +995,7 @@ TEST(SchedulerStateMachineTest, AbortBeginMainFrameAndCancelCommit) {
|
|
|
| // Start a new frame; draw because this is the first frame since output
|
| // surface init'd.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1043,7 +1047,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Become visible and start a new frame.
|
| state.SetVisible(true);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -1108,7 +1112,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_TRUE(state.NeedsCommit());
|
|
|
| // We should get that commit when we begin the next frame.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1145,7 +1149,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_TRUE(state.NeedsCommit());
|
|
|
| // Begin a frame when not visible, the scheduler animates but does not commit.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1171,14 +1175,14 @@ TEST(SchedulerStateMachineTest, TestFirstContextCreation) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Check that the first init does not SetNeedsCommit.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| 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(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1208,7 +1212,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhenCompletelyIdle) {
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
|
|
| // When the context is recreated, we should begin a commit.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1232,14 +1236,14 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Once context recreation begins, nothing should happen.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| 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(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1265,7 +1269,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Once the context is recreated, whether we draw should be based on
|
| // SetCanDraw.
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1293,7 +1297,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1328,7 +1332,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1360,7 +1364,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1395,7 +1399,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1416,7 +1420,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // After we get a new output surface, the commit flow should start.
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1452,7 +1456,7 @@ TEST(SchedulerStateMachineTest, DontDrawBeforeCommitAfterLostOutputSurface) {
|
| state.DidCreateAndInitializeOutputSurface();
|
|
|
| EXPECT_FALSE(state.RedrawPending());
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME,
|
| state.NextAction());
|
| }
|
| @@ -1584,7 +1588,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(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
|
|
| // As a response the compositor requests a redraw and a commit to tell the
|
| // main thread about the new scroll offset.
|
| @@ -1619,7 +1623,7 @@ void FinishPreviousCommitAndDrawWithoutExitingDeadline(
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -1644,7 +1648,7 @@ TEST(SchedulerStateMachineTest, TestImplLatencyTakesPriority) {
|
| // in prefer impl latency mode.
|
| state.SetNeedsRedraw(true);
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1681,7 +1685,7 @@ TEST(SchedulerStateMachineTest, TestImplLatencyTakesPriority) {
|
| // and did not just swap.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1699,7 +1703,7 @@ TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyOnLostOutputSurface) {
|
|
|
| state.SetNeedsCommit();
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1726,7 +1730,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.OnBeginImplFrameDeadlinePending();
|
| @@ -1752,7 +1756,7 @@ TEST(SchedulerStateMachineTest, TestAnimateBeforeCommit) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1780,7 +1784,7 @@ TEST(SchedulerStateMachineTest, TestAnimateAfterCommitBeforeDraw) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1812,7 +1816,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimateAfterAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
|
| + state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.SetNeedsAnimate();
|
|
|