Chromium Code Reviews| Index: cc/trees/layer_tree_host_unittest_scroll.cc |
| diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc |
| index 96e3419110afcafcf612712137d871be98b70389..d411c706a0364d13d0b683794da257e84f26c17b 100644 |
| --- a/cc/trees/layer_tree_host_unittest_scroll.cc |
| +++ b/cc/trees/layer_tree_host_unittest_scroll.cc |
| @@ -2079,12 +2079,11 @@ class LayerTreeHostScrollTestPropertyTreeUpdate |
| SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); |
| -// Disabled due to flakes/crashes, see https://crbug.com/697652. |
| -class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| +class LayerTreeHostScrollTestImplSideInvalidation |
| : public LayerTreeHostScrollTest { |
| void BeginTest() override { |
| layer_tree_host()->outer_viewport_scroll_layer()->set_did_scroll_callback( |
| - base::Bind(&DISABLED_LayerTreeHostScrollTestImplSideInvalidation:: |
| + base::Bind(&LayerTreeHostScrollTestImplSideInvalidation:: |
| DidScrollOuterViewport, |
| base::Unretained(this))); |
| PostSetNeedsCommitToMainThread(); |
| @@ -2096,10 +2095,9 @@ class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| { |
| CompletionEvent completion; |
| task_runner_provider()->ImplThreadTaskRunner()->PostTask( |
| - FROM_HERE, |
| - base::Bind(&DISABLED_LayerTreeHostScrollTestImplSideInvalidation:: |
| - WaitForInvalidationOnImplThread, |
| - base::Unretained(this), &completion)); |
| + FROM_HERE, base::Bind(&LayerTreeHostScrollTestImplSideInvalidation:: |
| + WaitForInvalidationOnImplThread, |
| + base::Unretained(this), &completion)); |
| completion.Wait(); |
| } |
| @@ -2171,18 +2169,12 @@ class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, |
| CommitEarlyOutReason reason) override { |
| - // The aborted main frame is bound to come after the fourth activation, |
| - // since the activation should occur synchronously after the impl-side |
| - // invalidation, and the main thread is released after this activation. It |
| - // should leave the scroll offset unchanged. |
| EXPECT_EQ(reason, CommitEarlyOutReason::FINISHED_NO_UPDATES); |
|
danakj
2017/03/06 16:41:44
btw these EXPECT_EQ are all backward, it should be
Khushal
2017/03/06 21:46:25
Done.
|
| - EXPECT_EQ(num_of_activations_, 4); |
| EXPECT_EQ(num_of_main_frames_, 3); |
| EXPECT_EQ(host_impl->active_tree() |
| ->OuterViewportScrollLayer() |
| ->CurrentScrollOffset(), |
| outer_viewport_offsets_[2]); |
| - EndTest(); |
| } |
| void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { |
| @@ -2228,6 +2220,11 @@ class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| } |
| } |
| + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| + if (++num_of_draws_ == 4) |
| + EndTest(); |
| + } |
| + |
| void AfterTest() override { |
| EXPECT_EQ(num_of_activations_, 4); |
| EXPECT_EQ(num_of_deltas_, 2); |
| @@ -2240,6 +2237,7 @@ class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| // Impl thread. |
| int num_of_activations_ = 0; |
| + int num_of_draws_ = 0; |
| int num_of_main_frames_ = 0; |
| bool invalidated_on_impl_thread_ = false; |
| CompletionEvent* impl_side_invalidation_event_ = nullptr; |
| @@ -2248,7 +2246,7 @@ class DISABLED_LayerTreeHostScrollTestImplSideInvalidation |
| int num_of_deltas_ = 0; |
| }; |
| -MULTI_THREAD_TEST_F(DISABLED_LayerTreeHostScrollTestImplSideInvalidation); |
| +MULTI_THREAD_TEST_F(LayerTreeHostScrollTestImplSideInvalidation); |
| } // namespace |
| } // namespace cc |