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

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

Issue 16833003: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 6 months 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 "cc/scheduler/scheduler.h" 7 #include "cc/scheduler/scheduler.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 StateMachine state(default_scheduler_settings); 91 StateMachine state(default_scheduler_settings);
92 state.SetCanStart(); 92 state.SetCanStart();
93 state.UpdateState(state.NextAction()); 93 state.UpdateState(state.NextAction());
94 state.DidCreateAndInitializeOutputSurface(); 94 state.DidCreateAndInitializeOutputSurface();
95 state.SetVisible(true); 95 state.SetVisible(true);
96 state.UpdateState( 96 state.UpdateState(
97 SchedulerStateMachine::ACTION_SEND_BEGIN_FRAME_TO_MAIN_THREAD); 97 SchedulerStateMachine::ACTION_SEND_BEGIN_FRAME_TO_MAIN_THREAD);
98 EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS, 98 EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_FRAME_IN_PROGRESS,
99 state.CommitState()); 99 state.CommitState());
100 EXPECT_FALSE(state.NeedsCommit()); 100 EXPECT_FALSE(state.NeedsCommit());
101 EXPECT_FALSE(state.BeginFrameNeededByImplThread()); 101 EXPECT_TRUE(state.BeginFrameNeededByImplThread());
102 } 102 }
103 } 103 }
104 104
105 TEST(SchedulerStateMachineTest, TestSetForcedRedrawDoesNotSetsNormalRedraw) { 105 TEST(SchedulerStateMachineTest, TestSetForcedRedrawDoesNotSetsNormalRedraw) {
106 SchedulerSettings default_scheduler_settings; 106 SchedulerSettings default_scheduler_settings;
107 SchedulerStateMachine state(default_scheduler_settings); 107 SchedulerStateMachine state(default_scheduler_settings);
108 state.SetCanDraw(true); 108 state.SetCanDraw(true);
109 state.SetNeedsForcedRedraw(); 109 state.SetNeedsForcedRedraw();
110 EXPECT_FALSE(state.RedrawPending()); 110 EXPECT_FALSE(state.RedrawPending());
111 EXPECT_TRUE(state.BeginFrameNeededByImplThread()); 111 EXPECT_TRUE(state.BeginFrameNeededByImplThread());
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 EXPECT_TRUE(state.DrawSuspendedUntilCommit()); 1287 EXPECT_TRUE(state.DrawSuspendedUntilCommit());
1288 1288
1289 EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction()); 1289 EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
1290 1290
1291 state.UpdateState(state.NextAction()); 1291 state.UpdateState(state.NextAction());
1292 EXPECT_FALSE(state.DrawSuspendedUntilCommit()); 1292 EXPECT_FALSE(state.DrawSuspendedUntilCommit());
1293 } 1293 }
1294 1294
1295 } // namespace 1295 } // namespace
1296 } // namespace cc 1296 } // 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