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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 23463014: cc: Poll for state that triggers draws (synchronous compositor only) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add test Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 3db7e6786012b723608e7188a8c8a55ba4e6f291..439269e1aee60b68b57cf5f91a7caa53075911ca 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2404,6 +2404,44 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
MULTI_THREAD_TEST_F(
LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
+class LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle
brianderson 2013/09/11 23:19:32 This test times out without the fix in this patch.
+ : public LayerTreeHostTest {
+ protected:
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle()
+ : commit_count_(0) {}
enne (OOO) 2013/09/11 23:28:12 style nit: this needs to be indented.
+
+ virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ settings->begin_frame_scheduling_enabled = true;
+ settings->using_synchronous_renderer_compositor = true;
+ }
+
+ virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+
+ virtual void DidCommit() OVERRIDE {
+ commit_count_++;
+ if (commit_count_== 2) {
+ // A commit was just aborted, request a real commit now.
+ layer_tree_host()->SetNeedsCommit();
+ } else if (commit_count_ == 3) {
+ // Make sure the real commit following an aborted commit will still
+ // complete.
+ EndTest();
+ }
+ }
+
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl *host_impl) OVERRIDE {
enne (OOO) 2013/09/11 23:28:12 style nit: '* ' not ' *'
+ // Initiate an aborted commit after every real commit.
+ host_impl->SetNeedsCommit();
+ }
+
+ virtual void AfterTest() OVERRIDE {}
enne (OOO) 2013/09/11 23:28:12 As a sanity check for this test, can you also chec
+
+ int commit_count_;
+};
+
+MULTI_THREAD_TEST_F(
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle);
+
class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
: public LayerTreeHostTest {
protected:
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698