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 117c7788e54e9436fe3ac4ab7e0bb5890cc07de5..dcb53952442f9dab833b2fe906f7c1b872f5bb0f 100644 |
--- a/cc/scheduler/scheduler_state_machine_unittest.cc |
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc |
@@ -35,7 +35,7 @@ class StateMachine : public SchedulerStateMachine { |
bool NeedsForcedRedraw() const { return needs_forced_redraw_; } |
bool CanDraw() const { return can_draw_; } |
- bool InsideVSync() const { return inside_vsync_; } |
+ bool InsideBeginFrame() const { return inside_begin_frame_; } |
bool Visible() const { return visible_; } |
}; |
@@ -52,12 +52,12 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsFrameIfNeeded) { |
state.SetNeedsRedraw(false); |
state.SetVisible(true); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
} |
@@ -68,12 +68,12 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsFrameIfNeeded) { |
state.SetNeedsRedraw(false); |
state.SetVisible(true); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
} |
@@ -84,7 +84,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsFrameIfNeeded) { |
state.SetCanStart(); |
state.SetNeedsRedraw(false); |
state.SetVisible(true); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
} |
// Begin the frame, make sure needs_commit and commit_state update correctly. |
@@ -98,7 +98,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsFrameIfNeeded) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS, |
state.CommitState()); |
EXPECT_FALSE(state.NeedsCommit()); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
} |
} |
@@ -108,7 +108,7 @@ TEST(SchedulerStateMachineTest, TestSetForcedRedrawDoesNotSetsNormalRedraw) { |
state.SetCanDraw(true); |
state.SetNeedsForcedRedraw(); |
EXPECT_FALSE(state.RedrawPending()); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
} |
TEST(SchedulerStateMachineTest, |
@@ -122,8 +122,8 @@ TEST(SchedulerStateMachineTest, |
state.SetCanDraw(true); |
state.SetNeedsRedraw(); |
EXPECT_TRUE(state.RedrawPending()); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
// We're drawing now. |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
@@ -152,8 +152,8 @@ TEST(SchedulerStateMachineTest, |
state.SetCanDraw(true); |
state.SetNeedsRedraw(); |
EXPECT_TRUE(state.RedrawPending()); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
// We're drawing now. |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
@@ -162,7 +162,7 @@ TEST(SchedulerStateMachineTest, |
EXPECT_FALSE(state.RedrawPending()); |
EXPECT_FALSE(state.CommitPending()); |
- // While still in the same vsync callback, set needs redraw again. |
+ // While still in the same BeginFrame callback, set needs redraw again. |
// This should not redraw. |
state.SetNeedsRedraw(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
@@ -191,8 +191,8 @@ TEST(SchedulerStateMachineTest, |
// Then initiate a draw. |
state.SetNeedsRedraw(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
EXPECT_TRUE(state.RedrawPending()); |
@@ -232,8 +232,8 @@ TEST(SchedulerStateMachineTest, |
// Then initiate a draw. |
state.SetNeedsRedraw(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
EXPECT_TRUE(state.RedrawPending()); |
@@ -285,8 +285,8 @@ TEST(SchedulerStateMachineTest, |
// Then initiate a draw. |
state.SetNeedsRedraw(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
EXPECT_TRUE(state.RedrawPending()); |
@@ -309,7 +309,7 @@ TEST(SchedulerStateMachineTest, |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
} |
-TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedNextVSync) { |
+TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedNextBeginFrame) { |
SchedulerSettings default_scheduler_settings; |
SchedulerStateMachine state(default_scheduler_settings); |
state.SetCanStart(); |
@@ -320,8 +320,8 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedNextVSync) { |
// Start a draw. |
state.SetNeedsRedraw(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
EXPECT_TRUE(state.RedrawPending()); |
@@ -334,11 +334,11 @@ TEST(SchedulerStateMachineTest, TestFailedDrawIsRetriedNextVSync) { |
// We should not be trying to draw again now, but we have a commit pending. |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_FRAME, state.NextAction()); |
- state.DidLeaveVSync(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ state.DidLeaveBeginFrame(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
- // We should try draw again in the next vsync. |
+ // We should try draw again in the next BeginFrame. |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
} |
@@ -351,32 +351,32 @@ TEST(SchedulerStateMachineTest, TestDoestDrawTwiceInSameFrame) { |
state.SetVisible(true); |
state.SetCanDraw(true); |
state.SetNeedsRedraw(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); |
- // While still in the same vsync callback, set needs redraw again. |
+ // While still in the same BeginFrame callback, set needs redraw again. |
// This should not redraw. |
state.SetNeedsRedraw(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
// Move to another frame. This should now draw. |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
- state.DidEnterVSync(); |
+ state.DidLeaveBeginFrame(); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); |
state.DidDrawIfPossibleCompleted(true); |
- EXPECT_FALSE(state.VSyncCallbackNeeded()); |
+ EXPECT_FALSE(state.BeginFrameCallbackNeeded()); |
} |
-TEST(SchedulerStateMachineTest, TestNextActionDrawsOnVSync) { |
+TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginFrame) { |
SchedulerSettings default_scheduler_settings; |
- // When not on vsync, or on vsync but not visible, don't draw. |
+ // When not in BeginFrame, or in BeginFrame but not visible, don't draw. |
size_t num_commit_states = |
sizeof(all_commit_states) / sizeof(SchedulerStateMachine::CommitState); |
for (size_t i = 0; i < num_commit_states; ++i) { |
@@ -388,7 +388,7 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnVSync) { |
state.SetCommitState(all_commit_states[i]); |
bool visible = j; |
if (!visible) { |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
state.SetVisible(false); |
} else { |
state.SetVisible(true); |
@@ -405,8 +405,8 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnVSync) { |
} |
} |
- // When on vsync, or not on vsync but needs_forced_dedraw set, should always |
- // draw except if you're ready to commit, in which case commit. |
+ // When in BeginFrame, or not in BeginFrame but needs_forced_dedraw set, |
+ // should always draw except if you're ready to commit, in which case commit. |
for (size_t i = 0; i < num_commit_states; ++i) { |
for (size_t j = 0; j < 2; ++j) { |
StateMachine state(default_scheduler_settings); |
@@ -417,7 +417,7 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnVSync) { |
state.SetCommitState(all_commit_states[i]); |
bool forced_draw = j; |
if (!forced_draw) { |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
state.SetNeedsRedraw(true); |
state.SetVisible(true); |
} else { |
@@ -435,12 +435,12 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnVSync) { |
} |
// Case 1: needs_commit=false. |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
EXPECT_EQ(expected_action, state.NextAction()); |
// Case 2: needs_commit=true. |
state.SetNeedsCommit(); |
- EXPECT_TRUE(state.VSyncCallbackNeeded()); |
+ EXPECT_TRUE(state.BeginFrameCallbackNeeded()); |
EXPECT_EQ(expected_action, state.NextAction()); |
} |
} |
@@ -452,7 +452,7 @@ TEST(SchedulerStateMachineTest, TestNoCommitStatesRedrawWhenInvisible) { |
size_t num_commit_states = |
sizeof(all_commit_states) / sizeof(SchedulerStateMachine::CommitState); |
for (size_t i = 0; i < num_commit_states; ++i) { |
- // There shouldn't be any drawing regardless of vsync. |
+ // There shouldn't be any drawing regardless of BeginFrame. |
for (size_t j = 0; j < 2; ++j) { |
StateMachine state(default_scheduler_settings); |
state.SetCanStart(); |
@@ -463,7 +463,7 @@ TEST(SchedulerStateMachineTest, TestNoCommitStatesRedrawWhenInvisible) { |
state.SetNeedsRedraw(true); |
state.SetNeedsForcedRedraw(false); |
if (j == 1) |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
// Case 1: needs_commit=false. |
EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, |
@@ -483,7 +483,7 @@ TEST(SchedulerStateMachineTest, TestCanRedraw_StopsDraw) { |
size_t num_commit_states = |
sizeof(all_commit_states) / sizeof(SchedulerStateMachine::CommitState); |
for (size_t i = 0; i < num_commit_states; ++i) { |
- // There shouldn't be any drawing regardless of vsync. |
+ // There shouldn't be any drawing regardless of BeginFrame. |
for (size_t j = 0; j < 2; ++j) { |
StateMachine state(default_scheduler_settings); |
state.SetCanStart(); |
@@ -494,7 +494,7 @@ TEST(SchedulerStateMachineTest, TestCanRedraw_StopsDraw) { |
state.SetNeedsRedraw(true); |
state.SetNeedsForcedRedraw(false); |
if (j == 1) |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
state.SetCanDraw(false); |
EXPECT_NE(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, |
@@ -544,13 +544,13 @@ TEST(SchedulerStateMachineTest, TestsetNeedsCommitIsNotLost) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, |
state.CommitState()); |
- // Expect to commit regardless of vsync state. |
- state.DidLeaveVSync(); |
+ // Expect to commit regardless of BeginFrame state. |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction()); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction()); |
- // Commit and make sure we draw on next vsync |
+ // Commit and make sure we draw on next BeginFrame |
state.UpdateState(SchedulerStateMachine::ACTION_COMMIT); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, |
@@ -559,7 +559,7 @@ TEST(SchedulerStateMachineTest, TestsetNeedsCommitIsNotLost) { |
state.DidDrawIfPossibleCompleted(true); |
// Verify that another commit will begin. |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_FRAME, state.NextAction()); |
} |
@@ -595,15 +595,15 @@ TEST(SchedulerStateMachineTest, TestFullCycle) { |
state.CommitState()); |
EXPECT_TRUE(state.NeedsRedraw()); |
- // Expect to do nothing until vsync. |
+ // Expect to do nothing until BeginFrame. |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
- // At vsync, draw. |
- state.DidEnterVSync(); |
+ // At BeginFrame, draw. |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Should be synchronized, no draw needed, no action needed. |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState()); |
@@ -647,15 +647,15 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) { |
state.CommitState()); |
EXPECT_TRUE(state.NeedsRedraw()); |
- // Expect to do nothing until vsync. |
+ // Expect to do nothing until BeginFrame. |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
- // At vsync, draw. |
- state.DidEnterVSync(); |
+ // At BeginFrame, draw. |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Should be synchronized, no draw needed, no action needed. |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState()); |
@@ -799,12 +799,12 @@ TEST(SchedulerStateMachineTest, |
// Once the context is recreated, whether we draw should be based on |
// SetCanDraw. |
state.SetNeedsRedraw(true); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.SetCanDraw(false); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
state.SetCanDraw(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
} |
TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) { |
@@ -823,10 +823,10 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) { |
// Set damage and expect a draw. |
state.SetNeedsRedraw(true); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Cause a lost context while the begin frame is in flight. |
state.DidLoseOutputSurface(); |
@@ -846,11 +846,12 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) { |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(state.NextAction()); |
- // Expect to be told to begin context recreation, independent of vsync state. |
- state.DidEnterVSync(); |
+ // Expect to be told to begin context recreation, independent of BeginFrame |
+ // state. |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
state.NextAction()); |
} |
@@ -872,10 +873,10 @@ TEST(SchedulerStateMachineTest, |
// Set damage and expect a draw. |
state.SetNeedsRedraw(true); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Cause a lost context while the begin frame is in flight. |
state.DidLoseOutputSurface(); |
@@ -896,11 +897,12 @@ TEST(SchedulerStateMachineTest, |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE, state.NextAction()); |
state.UpdateState(state.NextAction()); |
- // Expect to be told to begin context recreation, independent of vsync state |
- state.DidEnterVSync(); |
+ // Expect to be told to begin context recreation, independent of BeginFrame |
+ // state |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
state.NextAction()); |
} |
@@ -919,23 +921,24 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) { |
// Ask a forced redraw and verify it ocurrs. |
state.SetNeedsForcedRedraw(true); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Clear the forced redraw bit. |
state.SetNeedsForcedRedraw(false); |
- // Expect to be told to begin context recreation, independent of vsync state |
+ // Expect to be told to begin context recreation, independent of BeginFrame |
+ // state |
EXPECT_EQ(SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
state.NextAction()); |
state.UpdateState(state.NextAction()); |
// Ask a forced redraw and verify it ocurrs. |
state.SetNeedsForcedRedraw(true); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
} |
TEST(SchedulerStateMachineTest, DontDrawBeforeCommitAfterLostOutputSurface) { |
@@ -1065,13 +1068,13 @@ TEST(SchedulerStateMachineTest, TestImmediateBeginFrame) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW, |
state.CommitState()); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
state.SetNeedsForcedRedraw(true); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
state.UpdateState(state.NextAction()); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Should be waiting for the normal begin frame. |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS, |
@@ -1104,13 +1107,13 @@ TEST(SchedulerStateMachineTest, TestImmediateBeginFrameDuringCommit) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW, |
state.CommitState()); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
state.SetNeedsForcedRedraw(true); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
state.UpdateState(state.NextAction()); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Should be waiting for the normal begin frame. |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS, |
@@ -1142,13 +1145,13 @@ TEST(SchedulerStateMachineTest, ImmediateBeginFrameWhileInvisible) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW, |
state.CommitState()); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
state.SetNeedsForcedRedraw(true); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
state.UpdateState(state.NextAction()); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
// Should be waiting for the normal begin frame. |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS, |
@@ -1188,13 +1191,13 @@ TEST(SchedulerStateMachineTest, ImmediateBeginFrameWhileCantDraw) { |
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_FORCED_DRAW, |
state.CommitState()); |
- state.DidEnterVSync(); |
+ state.DidEnterBeginFrame(); |
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); |
state.SetNeedsForcedRedraw(true); |
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_FORCED, state.NextAction()); |
state.UpdateState(state.NextAction()); |
state.DidDrawIfPossibleCompleted(true); |
- state.DidLeaveVSync(); |
+ state.DidLeaveBeginFrame(); |
} |
TEST(SchedulerStateMachineTest, ReportIfNotDrawing) { |