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

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

Issue 723713003: cc: Add SetChildrenNeedBeginFrames() & SendBeginFramesToChildren() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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/scheduler/scheduler_unittest.cc » ('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 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698