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..fc1d582067d5cb93a96ddf622d578b51ad3844de 100644 |
--- a/cc/trees/layer_tree_host_unittest.cc |
+++ b/cc/trees/layer_tree_host_unittest.cc |
@@ -2404,6 +2404,51 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled |
MULTI_THREAD_TEST_F( |
LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); |
+class LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle |
+ : public LayerTreeHostTest { |
+ protected: |
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle() |
+ : commit_count_(0), commit_complete_count_(0) {} |
+ |
+ 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 to make sure a |
+ // real commit following an aborted commit will still complete and |
+ // end the test even when the Impl thread is idle. |
+ layer_tree_host()->SetNeedsCommit(); |
+ } |
+ } |
+ |
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
+ commit_complete_count_++; |
+ if (commit_complete_count_ == 1) { |
+ // Initiate an aborted commit after the first commit. |
+ host_impl->SetNeedsCommit(); |
+ } else { |
+ EndTest(); |
+ } |
+ } |
+ |
+ virtual void AfterTest() OVERRIDE { |
+ EXPECT_EQ(commit_count_, 3); |
+ EXPECT_EQ(commit_complete_count_, 2); |
+ } |
+ |
+ int commit_count_; |
+ int commit_complete_count_; |
+}; |
+ |
+MULTI_THREAD_TEST_F( |
+ LayerTreeHostTestAbortedCommitDoesntStallNextCommitWhenIdle); |
+ |
class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation |
: public LayerTreeHostTest { |
protected: |