Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp

Issue 10690121: Merge 121076 - [chromium] LayerRendererChromium is not getting visibility messages in single thread… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp (revision 122257)
+++ Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp (working copy)
@@ -765,7 +765,7 @@
EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
}
-TEST(CCSchedulerStateMachineTest, TestGoesInvisibleMidCommit)
+TEST(CCSchedulerStateMachineTest, TestGoesInvisibleBeforeBeginFrameCompletes)
{
StateMachine state;
state.setCanBeginFrame(true);
@@ -781,34 +781,13 @@
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();
+ // 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());
- state.didEnterVSync();
- EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction());
}
TEST(CCSchedulerStateMachineTest, TestContextLostWhenCompletelyIdle)
« no previous file with comments | « Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp ('k') | Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698