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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 state.SetCanStart(); 696 state.SetCanStart();
697 state.UpdateState(state.NextAction()); 697 state.UpdateState(state.NextAction());
698 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); 698 state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
699 699
700 state.SetActiveTreeNeedsFirstDraw(true); 700 state.SetActiveTreeNeedsFirstDraw(true);
701 state.SetNeedsCommit(); 701 state.SetNeedsCommit();
702 state.SetNeedsRedraw(true); 702 state.SetNeedsRedraw(true);
703 state.SetVisible(true); 703 state.SetVisible(true);
704 state.SetCanDraw(false); 704 state.SetCanDraw(false);
705 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting()); 705 state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
706 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
706 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT); 707 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
707 EXPECT_ACTION_UPDATE_STATE( 708 EXPECT_ACTION_UPDATE_STATE(
708 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); 709 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
709 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 710 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
710 state.NotifyBeginMainFrameStarted(); 711 state.NotifyBeginMainFrameStarted();
711 state.NotifyReadyToCommit(); 712 state.NotifyReadyToCommit();
712 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); 713 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
713 state.OnBeginImplFrameDeadline(); 714 state.OnBeginImplFrameDeadline();
715 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
714 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT); 716 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
715 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 717 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
716 } 718 }
717 719
718 TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) { 720 TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) {
719 SchedulerSettings scheduler_settings; 721 SchedulerSettings scheduler_settings;
720 StateMachine state(scheduler_settings); 722 StateMachine state(scheduler_settings);
721 state.SetCanStart(); 723 state.SetCanStart();
722 state.UpdateState(state.NextAction()); 724 state.UpdateState(state.NextAction());
723 state.CreateAndInitializeOutputSurfaceWithActivatedCommit(); 725 state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 state.SetNeedsAnimate(); 1818 state.SetNeedsAnimate();
1817 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 1819 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
1818 1820
1819 state.OnBeginImplFrameDeadline(); 1821 state.OnBeginImplFrameDeadline();
1820 EXPECT_ACTION_UPDATE_STATE( 1822 EXPECT_ACTION_UPDATE_STATE(
1821 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); 1823 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
1822 } 1824 }
1823 1825
1824 } // namespace 1826 } // namespace
1825 } // namespace cc 1827 } // 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