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

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

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase; change names; use enum class Created 5 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/trace_event/trace_event.h" 7 #include "base/trace_event/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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 state.SetNeedsBeginMainFrame(); 1894 state.SetNeedsBeginMainFrame();
1895 state.OnBeginImplFrame(); 1895 state.OnBeginImplFrame();
1896 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE); 1896 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
1897 EXPECT_ACTION_UPDATE_STATE( 1897 EXPECT_ACTION_UPDATE_STATE(
1898 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); 1898 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
1899 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 1899 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
1900 1900
1901 // Verify the deadline is not triggered early until we enter 1901 // Verify the deadline is not triggered early until we enter
1902 // prefer impl latency mode. 1902 // prefer impl latency mode.
1903 EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); 1903 EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineImmediately());
1904 state.SetImplLatencyTakesPriority(true); 1904 state.SetTreePrioritiesAndScrollState(
1905 SMOOTHNESS_TAKES_PRIORITY,
1906 ScrollHandlerState::SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER);
1905 EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); 1907 EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineImmediately());
1906 1908
1907 // Trigger the deadline. 1909 // Trigger the deadline.
1908 state.OnBeginImplFrameDeadline(); 1910 state.OnBeginImplFrameDeadline();
1909 EXPECT_ACTION_UPDATE_STATE( 1911 EXPECT_ACTION_UPDATE_STATE(
1910 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); 1912 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
1911 state.DidSwapBuffers(); 1913 state.DidSwapBuffers();
1912 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); 1914 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
1913 state.DidSwapBuffersComplete(); 1915 state.DidSwapBuffersComplete();
1914 1916
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2131 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2130 bool commit_has_no_updates = true; 2132 bool commit_has_no_updates = true;
2131 state.WillCommit(commit_has_no_updates); 2133 state.WillCommit(commit_has_no_updates);
2132 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); 2134 EXPECT_TRUE(state.ProactiveBeginFrameWanted());
2133 state.OnBeginImplFrame(); 2135 state.OnBeginImplFrame();
2134 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2136 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2135 } 2137 }
2136 2138
2137 } // namespace 2139 } // namespace
2138 } // namespace cc 2140 } // 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