| 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 3dfe9341b79851e8a72aeeabab95373083dfad15..a72cdabf631f3a305558ccc2b92778e2e5f88667 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/output_test_common.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(BeginFrameArgsCreateForTesting());
|
|
|
| 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(BeginFrameArgsCreateForTesting());
|
| 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(BeginFrameArgsCreateForTesting());
|
| 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(BeginFrameArgsCreateForTesting());
|
| 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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Verify NotifyReadyToActivate unblocks activation, draw, and
|
| @@ -273,7 +274,7 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Commit to the pending tree.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -289,7 +290,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -329,7 +330,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -345,7 +346,7 @@ TEST(SchedulerStateMachineTest,
|
| // Failing the draw makes us require a commit.
|
| state.DidDrawIfPossibleCompleted(
|
| DrawSwapReadbackResult::DRAW_ABORTED_CHECKERBOARD_ANIMATIONS);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -365,7 +366,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawForMissingHighResNeedsCommit) {
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -378,7 +379,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_FALSE(state.RedrawPending());
|
| @@ -398,7 +399,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.RedrawPending());
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -418,7 +419,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -441,7 +442,7 @@ void TestFailedDrawsEventuallyForceDrawAfterNextCommit(
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -472,7 +473,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| if (main_frame_before_draw_enabled) {
|
| EXPECT_ACTION_UPDATE_STATE(
|
| @@ -514,7 +515,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) {
|
| // Start a commit.
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -575,7 +576,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedInNextBeginImplFrame) {
|
| // Start a draw.
|
| state.SetNeedsRedraw(true);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -593,7 +594,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -617,7 +618,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Draw the first frame.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -634,7 +635,7 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) {
|
|
|
| // Move to another frame. This should now draw.
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
|
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -783,7 +784,7 @@ TEST(SchedulerStateMachineTest, TestCanRedraw_StopsDraw) {
|
| state.SetVisible(false);
|
| state.SetNeedsRedraw(true);
|
| if (j == 1)
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
|
|
| state.SetCanDraw(false);
|
| EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE,
|
| @@ -805,7 +806,7 @@ TEST(SchedulerStateMachineTest,
|
| state.SetNeedsRedraw(true);
|
| state.SetVisible(true);
|
| state.SetCanDraw(false);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -833,7 +834,7 @@ void TestSetNeedsCommitIsNotLost(bool main_frame_before_draw_enabled) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -869,7 +870,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
|
| @@ -920,7 +921,7 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -968,7 +969,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -1007,7 +1008,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
|
| EXPECT_FALSE(state.needs_redraw());
|
|
|
| // Next BeginImplFrame should initiate second commit.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1035,7 +1036,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| state.SetNeedsCommit();
|
|
|
| // Begin the frame while visible.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
|
| @@ -1065,7 +1066,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
|
| EXPECT_TRUE(state.NeedsCommit());
|
|
|
| // Start a new frame.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
|
|
| @@ -1104,7 +1105,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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1136,14 +1137,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(BeginFrameArgsCreateForTesting());
|
| 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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1173,7 +1174,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhenCompletelyIdle) {
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
|
|
| // When the context is recreated, we should begin a commit.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| }
|
| @@ -1197,14 +1198,14 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| // Once context recreation begins, nothing should happen.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| 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(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1230,7 +1231,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Once the context is recreated, whether we draw should be based on
|
| // SetCanDraw.
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1258,7 +1259,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1291,7 +1292,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1323,7 +1324,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // Set damage and expect a draw.
|
| state.SetNeedsRedraw(true);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -1356,7 +1357,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION,
|
| state.NextAction());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING,
|
| state.begin_impl_frame_state());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
|
| @@ -1377,7 +1378,7 @@ TEST(SchedulerStateMachineTest,
|
|
|
| // After we get a new output surface, the commit flow should start.
|
| state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1406,7 +1407,7 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) {
|
|
|
| // Ask a forced redraw for readback and verify it ocurrs.
|
| state.SetNeedsForcedRedrawForReadback();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| @@ -1456,7 +1457,7 @@ TEST(SchedulerStateMachineTest, DontDrawBeforeCommitAfterLostOutputSurface) {
|
| state.DidCreateAndInitializeOutputSurface();
|
|
|
| EXPECT_FALSE(state.RedrawPending());
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_EQ(SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME,
|
| state.NextAction());
|
| }
|
| @@ -1549,7 +1550,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) {
|
| state.NotifyReadyToCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1654,7 +1655,7 @@ void TestForceCommitWhenReplacementActivationInProgress(
|
| }
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| // Perform the draw & swap of replacement commit.
|
| @@ -1694,7 +1695,7 @@ void TestForceCommitWhenReplacementActivationInProgress(
|
| state.NotifyReadyToActivate();
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE);
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| state.OnBeginImplFrameDeadline();
|
| @@ -1744,7 +1745,7 @@ TEST(SchedulerStateMachineTest,
|
| // New commit is requested and scheduled when impl-side painting is in
|
| // progress.
|
| state.SetNeedsCommit();
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| @@ -1765,7 +1766,7 @@ TEST(SchedulerStateMachineTest,
|
| EXPECT_FALSE(state.NeedsCommit());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| // Perform the draw & swap of replacement commit.
|
| @@ -1996,7 +1997,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(BeginFrameArgsCreateForTesting());
|
|
|
| // As a response the compositor requests a redraw and a commit to tell the
|
| // main thread about the new scroll offset.
|
| @@ -2030,7 +2031,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(BeginFrameArgsCreateForTesting());
|
| state.SetNeedsRedraw(true);
|
| state.SetNeedsCommit();
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| @@ -2059,7 +2060,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.OnBeginImplFrameDeadlinePending();
|
| @@ -2085,7 +2086,7 @@ TEST(SchedulerStateMachineTest, TestAnimateBeforeCommit) {
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
| EXPECT_ACTION_UPDATE_STATE(
|
| SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
|
| @@ -2112,7 +2113,7 @@ TEST(SchedulerStateMachineTest, TestSetNeedsAnimateAfterAnimate) {
|
| EXPECT_TRUE(state.BeginFrameNeeded());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
|
|
|
| - state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
|
| + state.OnBeginImplFrame(BeginFrameArgsCreateForTesting());
|
| EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
|
|
|
| state.SetNeedsAnimate();
|
|
|