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

Unified Diff: cc/scheduler/scheduler_state_machine_unittest.cc

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: 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 7036459794ffd34cc16364b34fba0d55cd65b478..b3bb6320655b780f062c0aeef783fa782382bc88 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -718,7 +718,7 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
// Become invisible and abort the main thread's begin frame.
state.SetVisible(false);
- state.BeginFrameAbortedByMainThread();
+ state.BeginFrameAbortedByMainThread(false);
// We should now be back in the idle state as if we didn't start a frame at
// all.
@@ -728,6 +728,15 @@ TEST(SchedulerStateMachineTest, TestGoesInvisibleBeforeFinishCommit) {
// Become visible again.
state.SetVisible(true);
+ // Because we have aborted on this frame, don't start another frame yet.
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState());
+ EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
+
+ // Start a new frame.
+ state.DidEnterBeginFrame(BeginFrameArgs::CreateForTesting());
+ EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
+ state.DidLeaveBeginFrame();
+
// We should be beginning a frame now.
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState());
EXPECT_EQ(SchedulerStateMachine::ACTION_SEND_BEGIN_FRAME_TO_MAIN_THREAD,
@@ -1192,7 +1201,7 @@ TEST(SchedulerStateMachineTest,
// Become invisible and abort the main thread's begin frame.
state.SetVisible(false);
- state.BeginFrameAbortedByMainThread();
+ state.BeginFrameAbortedByMainThread(false);
brianderson 2013/07/13 01:26:42 Should we add a test for BeginFrameAbortedByMainTh
enne (OOO) 2013/07/15 22:23:28 Oh, quite right, done.
// Should be back in the idle state, but needing a commit.
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_IDLE, state.CommitState());

Powered by Google App Engine
This is Rietveld 408576698