Chromium Code Reviews| 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 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1831 state.UpdateState(state.NextAction()); | 1831 state.UpdateState(state.NextAction()); |
| 1832 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); | 1832 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); |
| 1833 state.SetVisible(true); | 1833 state.SetVisible(true); |
| 1834 state.SetCanDraw(true); | 1834 state.SetCanDraw(true); |
| 1835 | 1835 |
| 1836 EXPECT_FALSE(state.BeginFrameNeeded()); | 1836 EXPECT_FALSE(state.BeginFrameNeeded()); |
| 1837 state.SetChildrenNeedBeginFrames(true); | 1837 state.SetChildrenNeedBeginFrames(true); |
| 1838 EXPECT_TRUE(state.BeginFrameNeeded()); | 1838 EXPECT_TRUE(state.BeginFrameNeeded()); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 TEST(SchedulerStateMachineTest, TestDeferCommit) { | |
| 1842 SchedulerSettings settings; | |
| 1843 StateMachine state(settings); | |
| 1844 state.SetCanStart(); | |
| 1845 state.UpdateState(state.NextAction()); | |
| 1846 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); | |
| 1847 state.SetVisible(true); | |
| 1848 state.SetCanDraw(true); | |
| 1849 | |
| 1850 state.SetDeferCommits(true); | |
| 1851 | |
| 1852 state.SetNeedsCommit(); | |
| 1853 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | |
| 1854 | |
| 1855 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting()); | |
|
brianderson
2014/12/03 02:12:10
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::
simonhong
2015/01/19 14:53:33
Done.
| |
| 1856 | |
| 1857 state.OnBeginImplFrameDeadlinePending(); | |
|
brianderson
2014/12/03 02:12:10
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::
simonhong
2015/01/19 14:53:33
This is removed.
| |
| 1858 state.OnBeginImplFrameDeadline(); | |
| 1859 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | |
| 1860 } | |
| 1861 | |
| 1841 } // namespace | 1862 } // namespace |
| 1842 } // namespace cc | 1863 } // namespace cc |
| OLD | NEW |