[cc] Modify TestNextActionBeginsMainFrameIfNeeded

In the second and third test of TestNextActionsBeginsMainFrameIfNeeded,
they test when commit is requested. But, both tests doesn't set commit is needed.
Also, third test should check whether next action is BEGIN_MAIN_FRAME or not.

R=brianderson@chromium.org
BUG=NONE
TEST=cc_unittests --gtest_filter=*.TestNextActionBeginsMainFrameIfNeeded

Review URL: https://codereview.chromium.org/170283008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252144 0039d316-1c4b-4281-b951-d872f2087c98
parent 41455780
......@@ -139,6 +139,7 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
state.SetCommitState(SchedulerStateMachine::COMMIT_STATE_IDLE);
state.SetNeedsRedraw(false);
state.SetVisible(true);
state.SetNeedsCommit();
EXPECT_FALSE(state.BeginImplFrameNeeded());
......@@ -154,9 +155,17 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
StateMachine state(default_scheduler_settings);
state.SetCommitState(SchedulerStateMachine::COMMIT_STATE_IDLE);
state.SetCanStart();
state.UpdateState(state.NextAction());
state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
state.SetNeedsRedraw(false);
state.SetVisible(true);
EXPECT_FALSE(state.BeginImplFrameNeeded());
state.SetNeedsCommit();
EXPECT_TRUE(state.BeginImplFrameNeeded());
state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
}
// Begin the frame, make sure needs_commit and commit_state update correctly.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment