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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1922 state.UpdateState(state.NextAction()); | 1922 state.UpdateState(state.NextAction()); |
| 1923 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); | 1923 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); |
| 1924 state.SetVisible(true); | 1924 state.SetVisible(true); |
| 1925 state.SetCanDraw(true); | 1925 state.SetCanDraw(true); |
| 1926 | 1926 |
| 1927 EXPECT_FALSE(state.BeginFrameNeeded()); | 1927 EXPECT_FALSE(state.BeginFrameNeeded()); |
| 1928 state.SetChildrenNeedBeginFrames(true); | 1928 state.SetChildrenNeedBeginFrames(true); |
| 1929 EXPECT_TRUE(state.BeginFrameNeeded()); | 1929 EXPECT_TRUE(state.BeginFrameNeeded()); |
| 1930 } | 1930 } |
| 1931 | 1931 |
| 1932 TEST(SchedulerStateMachineTest, TestDeferCommit) { | |
| 1933 SchedulerSettings settings; | |
| 1934 StateMachine state(settings); | |
| 1935 state.SetCanStart(); | |
| 1936 state.UpdateState(state.NextAction()); | |
| 1937 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); | |
| 1938 state.SetVisible(true); | |
| 1939 state.SetCanDraw(true); | |
| 1940 | |
| 1941 state.SetDeferCommits(true); | |
|
enne (OOO)
2015/01/23 01:35:21
Can you make this test set defer commits back to f
simonhong
2015/01/28 19:44:24
Done.
| |
| 1942 | |
| 1943 state.SetNeedsCommit(); | |
| 1944 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | |
| 1945 | |
| 1946 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); | |
| 1947 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | |
| 1948 | |
| 1949 state.OnBeginImplFrameDeadline(); | |
| 1950 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | |
| 1951 } | |
| 1952 | |
| 1932 } // namespace | 1953 } // namespace |
| 1933 } // namespace cc | 1954 } // namespace cc |
| OLD | NEW |