| 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/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 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE); | 1816 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE); |
| 1817 | 1817 |
| 1818 state.SetNeedsAnimate(); | 1818 state.SetNeedsAnimate(); |
| 1819 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1819 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
| 1820 | 1820 |
| 1821 state.OnBeginImplFrameDeadline(); | 1821 state.OnBeginImplFrameDeadline(); |
| 1822 EXPECT_ACTION_UPDATE_STATE( | 1822 EXPECT_ACTION_UPDATE_STATE( |
| 1823 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); | 1823 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); |
| 1824 } | 1824 } |
| 1825 | 1825 |
| 1826 TEST(SchedulerStateMachineTest, TestForwardBeginFramesToChildren) { |
| 1827 SchedulerSettings settings; |
| 1828 settings.forward_begin_frames_to_children = true; |
| 1829 StateMachine state(settings); |
| 1830 state.SetCanStart(); |
| 1831 state.UpdateState(state.NextAction()); |
| 1832 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); |
| 1833 state.SetVisible(true); |
| 1834 state.SetCanDraw(true); |
| 1835 |
| 1836 EXPECT_FALSE(state.BeginFrameNeeded()); |
| 1837 state.SetChildrenNeedBeginFrames(true); |
| 1838 EXPECT_TRUE(state.BeginFrameNeeded()); |
| 1839 } |
| 1840 |
| 1826 } // namespace | 1841 } // namespace |
| 1827 } // namespace cc | 1842 } // namespace cc |
| OLD | NEW |