OLD | NEW |
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/trace_event/trace_event.h" | 7 #include "base/trace_event/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 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 state.SetNeedsAnimate(); | 1797 state.SetNeedsAnimate(); |
1798 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1798 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
1799 | 1799 |
1800 state.OnBeginImplFrameDeadline(); | 1800 state.OnBeginImplFrameDeadline(); |
1801 EXPECT_ACTION_UPDATE_STATE( | 1801 EXPECT_ACTION_UPDATE_STATE( |
1802 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); | 1802 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); |
1803 } | 1803 } |
1804 | 1804 |
1805 TEST(SchedulerStateMachineTest, TestForwardBeginFramesToChildren) { | 1805 TEST(SchedulerStateMachineTest, TestForwardBeginFramesToChildren) { |
1806 SchedulerSettings settings; | 1806 SchedulerSettings settings; |
1807 settings.forward_begin_frames_to_children = true; | |
1808 StateMachine state(settings); | 1807 StateMachine state(settings); |
1809 SET_UP_STATE(state) | 1808 SET_UP_STATE(state) |
1810 | 1809 |
1811 EXPECT_FALSE(state.BeginFrameNeeded()); | 1810 EXPECT_FALSE(state.BeginFrameNeeded()); |
1812 state.SetChildrenNeedBeginFrames(true); | 1811 state.SetChildrenNeedBeginFrames(true); |
1813 EXPECT_TRUE(state.BeginFrameNeeded()); | 1812 EXPECT_TRUE(state.BeginFrameNeeded()); |
1814 } | 1813 } |
1815 | 1814 |
1816 TEST(SchedulerStateMachineTest, TestDeferCommit) { | 1815 TEST(SchedulerStateMachineTest, TestDeferCommit) { |
1817 SchedulerSettings settings; | 1816 SchedulerSettings settings; |
(...skipping 13 matching lines...) Expand all Loading... |
1831 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1830 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
1832 | 1831 |
1833 state.SetDeferCommits(false); | 1832 state.SetDeferCommits(false); |
1834 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); | 1833 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); |
1835 EXPECT_ACTION_UPDATE_STATE( | 1834 EXPECT_ACTION_UPDATE_STATE( |
1836 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); | 1835 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); |
1837 } | 1836 } |
1838 | 1837 |
1839 } // namespace | 1838 } // namespace |
1840 } // namespace cc | 1839 } // namespace cc |
OLD | NEW |