Chromium Code Reviews| 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: |