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

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

Issue 1394263004: android webview: allow cc to fail hardware draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + clean ups Created 5 years, 2 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
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 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 1781
1782 state.SetCanDraw(false); 1782 state.SetCanDraw(false);
1783 state.SetVisible(false); 1783 state.SetVisible(false);
1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); 1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
1785 1785
1786 state.SetCanDraw(true); 1786 state.SetCanDraw(true);
1787 state.SetVisible(true); 1787 state.SetVisible(true);
1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); 1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1789 } 1789 }
1790 1790
1791 TEST(SchedulerStateMachineTest, ForceDrawForSynchronousCompositor) { 1791 TEST(SchedulerStateMachineTest, ForceDrawForResourcelessSoftwareDraw) {
1792 SchedulerSettings scheduler_settings; 1792 SchedulerSettings scheduler_settings;
1793 scheduler_settings.using_synchronous_renderer_compositor = true;
1794 StateMachine state(scheduler_settings); 1793 StateMachine state(scheduler_settings);
1794 state.SetResourcelessSoftareDraw(true);
brianderson 2015/10/21 22:43:04 Since this is a dynamic setting now, can you updat
boliu 2015/10/21 23:04:44 Done.
1795 SET_UP_STATE(state) 1795 SET_UP_STATE(state)
1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted());
1797 1797
1798 state.SetVisible(false); 1798 state.SetVisible(false);
1799 state.DidLoseOutputSurface(); 1799 state.DidLoseOutputSurface();
1800 1800
1801 state.SetCanDraw(false); 1801 state.SetCanDraw(false);
1802 state.WillBeginOutputSurfaceCreation(); 1802 state.WillBeginOutputSurfaceCreation();
1803 state.DidCreateAndInitializeOutputSurface(); 1803 state.DidCreateAndInitializeOutputSurface();
1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); 1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2096 bool commit_has_no_updates = true; 2096 bool commit_has_no_updates = true;
2097 state.WillCommit(commit_has_no_updates); 2097 state.WillCommit(commit_has_no_updates);
2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); 2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted());
2099 state.OnBeginImplFrame(); 2099 state.OnBeginImplFrame();
2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); 2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted());
2101 } 2101 }
2102 2102
2103 } // namespace 2103 } // namespace
2104 } // namespace cc 2104 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698