summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp31
1 files changed, 5 insertions, 26 deletions
diff --git a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
index a99149ba9..2e31d44d0 100644
--- a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
+++ b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
@@ -807,7 +807,7 @@ TEST(CCSchedulerStateMachineTest, TestRequestCommitInvisible)
EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
}
-TEST(CCSchedulerStateMachineTest, TestGoesInvisibleMidCommit)
+TEST(CCSchedulerStateMachineTest, TestGoesInvisibleBeforeBeginFrameCompletes)
{
StateMachine state;
state.setCanBeginFrame(true);
@@ -823,33 +823,12 @@ TEST(CCSchedulerStateMachineTest, TestGoesInvisibleMidCommit)
EXPECT_FALSE(state.needsCommit());
EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
- // Become invisible
+ // Become invisible and abort the beginFrame.
state.setVisible(false);
+ state.beginFrameAborted();
- // Tell the scheduler the frame finished
- state.beginFrameComplete();
- EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_UPDATING_RESOURCES, state.commitState());
- EXPECT_EQ(CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES, state.nextAction());
-
- // Tell the scheduler the update began and finished
- state.updateState(CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES);
- state.beginUpdateMoreResourcesComplete(false);
- EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, state.commitState());
- EXPECT_EQ(CCSchedulerStateMachine::ACTION_COMMIT, state.nextAction());
-
- // Commit in invisible state should leave us:
- // - COMMIT_STATE_WAITING_FOR_FIRST_DRAW
- // - Waiting for redraw.
- // - No commit needed
- state.updateState(CCSchedulerStateMachine::ACTION_COMMIT);
- EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, state.commitState());
- EXPECT_TRUE(state.needsRedraw());
- EXPECT_FALSE(state.needsCommit());
-
- // Expect to do nothing, both in and out of vsync.
- state.didLeaveVSync();
- EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
- state.didEnterVSync();
+ // We should now be back in the idle state as if we didn't start a frame at all.
+ EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_IDLE, state.commitState());
EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
}