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

Side by Side Diff: cc/scheduler/scheduler_state_machine_unittest.cc

Issue 713783002: Revert of Moving background animation ticking from LayerTreeHostImpl into the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler-timesource-refactor
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/scheduler/scheduler_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/scheduler/scheduler.h" 8 #include "cc/scheduler/scheduler.h"
9 #include "cc/test/begin_frame_args_test.h" 9 #include "cc/test/begin_frame_args_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 state.SetCanStart(); 696 state.SetCanStart();
697 state.UpdateState(state.NextAction()); 697 state.UpdateState(state.NextAction());
698 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); 698 state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
699 699
700 state.SetActiveTreeNeedsFirstDraw(true); 700 state.SetActiveTreeNeedsFirstDraw(true);
701 state.SetNeedsCommit(); 701 state.SetNeedsCommit();
702 state.SetNeedsRedraw(true); 702 state.SetNeedsRedraw(true);
703 state.SetVisible(true); 703 state.SetVisible(true);
704 state.SetCanDraw(false); 704 state.SetCanDraw(false);
705 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting()); 705 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
706 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
707 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT); 706 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
708 EXPECT_ACTION_UPDATE_STATE( 707 EXPECT_ACTION_UPDATE_STATE(
709 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); 708 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
710 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 709 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
711 state.NotifyBeginMainFrameStarted(); 710 state.NotifyBeginMainFrameStarted();
712 state.NotifyReadyToCommit(); 711 state.NotifyReadyToCommit();
713 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); 712 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
714 state.OnBeginImplFrameDeadline(); 713 state.OnBeginImplFrameDeadline();
715 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
716 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT); 714 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
717 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 715 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
718 } 716 }
719 717
720 TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) { 718 TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) {
721 SchedulerSettings scheduler_settings; 719 SchedulerSettings scheduler_settings;
722 StateMachine state(scheduler_settings); 720 StateMachine state(scheduler_settings);
723 state.SetCanStart(); 721 state.SetCanStart();
724 state.UpdateState(state.NextAction()); 722 state.UpdateState(state.NextAction());
725 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); 723 state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 state.SetNeedsAnimate(); 1816 state.SetNeedsAnimate();
1819 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 1817 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
1820 1818
1821 state.OnBeginImplFrameDeadline(); 1819 state.OnBeginImplFrameDeadline();
1822 EXPECT_ACTION_UPDATE_STATE( 1820 EXPECT_ACTION_UPDATE_STATE(
1823 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); 1821 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
1824 } 1822 }
1825 1823
1826 } // namespace 1824 } // namespace
1827 } // namespace cc 1825 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698