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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 206793003: cc: Split animating and drawing into separate actions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix input handler proxy test build. Created 6 years, 8 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
« no previous file with comments | « cc/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_unittest.cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index a5d279bcefe1644f9c6733ade7ca836e11ffd9ea..921b94af19f0d2e605434276663c7a8aab70d998 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -109,6 +109,10 @@ class FakeSchedulerClient : public SchedulerClient {
actions_.push_back("ScheduledActionSendBeginMainFrame");
states_.push_back(scheduler_->StateAsValue().release());
}
+ virtual void ScheduledActionAnimate() OVERRIDE {
+ actions_.push_back("ScheduledActionAnimate");
+ states_.push_back(scheduler_->StateAsValue().release());
+ }
virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible()
OVERRIDE {
actions_.push_back("ScheduledActionDrawAndSwapIfPossible");
@@ -286,7 +290,8 @@ TEST(SchedulerTest, RequestCommit) {
// BeginImplFrame should prepare the draw.
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame());
client.Reset();
@@ -348,7 +353,8 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
client.Reset();
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
// Because we just swapped, the Scheduler should also request the next
@@ -371,7 +377,8 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
client.Reset();
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame());
client.Reset();
@@ -738,7 +745,8 @@ TEST(SchedulerTest, ManageTiles) {
// the deadline task.
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
// On the deadline, he actions should have occured in the right order.
@@ -765,7 +773,8 @@ TEST(SchedulerTest, ManageTiles) {
// the deadline task.
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
// Draw. The draw will trigger SetNeedsManageTiles, and
@@ -832,7 +841,8 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
scheduler->SetNeedsRedraw();
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(scheduler->ManageTilesPending());
@@ -853,7 +863,8 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
scheduler->SetNeedsRedraw();
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
client.Reset();
@@ -875,7 +886,8 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
scheduler->SetNeedsRedraw();
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(scheduler->ManageTilesPending());
@@ -897,7 +909,8 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
scheduler->SetNeedsRedraw();
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(scheduler->ManageTilesPending());
@@ -915,7 +928,8 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) {
scheduler->SetNeedsRedraw();
client.Reset();
scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
client.Reset();
@@ -1171,7 +1185,8 @@ TEST(SchedulerTest, BeginRetroFrame) {
// BeginImplFrame should prepare the draw.
client.task_runner().RunPendingTasks(); // Run posted BeginRetroFrame.
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame());
client.Reset();
@@ -1244,7 +1259,8 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) {
// Swapping will put us into a swap throttled state.
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame());
client.Reset();
@@ -1276,7 +1292,8 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) {
// BeginImplFrame deadline should draw.
scheduler->SetNeedsRedraw();
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame());
client.Reset();
@@ -1328,7 +1345,8 @@ void BeginFramesNotFromClient(bool begin_frame_scheduling_enabled,
// BeginImplFrame should prepare the draw.
client.task_runner().RunPendingTasks(); // Run posted BeginFrame.
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frame());
client.Reset();
@@ -1417,7 +1435,8 @@ void BeginFramesNotFromClient_SwapThrottled(bool begin_frame_scheduling_enabled,
// Swapping will put us into a swap throttled state.
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frame());
client.Reset();
@@ -1441,7 +1460,8 @@ void BeginFramesNotFromClient_SwapThrottled(bool begin_frame_scheduling_enabled,
// BeginImplFrame deadline should draw.
scheduler->SetNeedsRedraw();
client.task_runner().RunPendingTasks(); // Run posted deadline.
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1);
+ EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2);
EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frame());
client.Reset();
« no previous file with comments | « cc/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698