Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl_unittest.cc |
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
| index 72b431a63100516e18878d1195291782b1f6d7da..424a1a2863a0b7250cd5edf18f636a29495af422 100644 |
| --- a/cc/trees/layer_tree_host_impl_unittest.cc |
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc |
| @@ -2865,19 +2865,22 @@ class LayerTreeHostImplTestScrollbarOpacity : public LayerTreeHostImplTest { |
| VERTICAL, 10, 0, false, true); |
| scrollbar->test_properties()->opacity = 0.f; |
| LayerImpl* scroll = host_impl_->pending_tree()->OuterViewportScrollLayer(); |
| - LayerImpl* root = host_impl_->pending_tree()->InnerViewportContainerLayer(); |
| + LayerImpl* container = |
| + host_impl_->pending_tree()->InnerViewportContainerLayer(); |
| scrollbar->SetScrollLayerId(scroll->id()); |
| - root->AddChild(std::move(scrollbar)); |
| + container->AddChild(std::move(scrollbar)); |
| host_impl_->pending_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f); |
| host_impl_->pending_tree()->BuildPropertyTreesForTesting(); |
| host_impl_->ActivateSyncTree(); |
| - LayerImpl* scrollbar_layer = host_impl_->active_tree()->LayerById(400); |
| + LayerImpl* active_scrollbar_layer = |
| + host_impl_->active_tree()->LayerById(400); |
| EffectNode* active_tree_node = |
| host_impl_->active_tree()->property_trees()->effect_tree.Node( |
| - scrollbar_layer->effect_tree_index()); |
| - EXPECT_FLOAT_EQ(scrollbar_layer->Opacity(), active_tree_node->data.opacity); |
| + active_scrollbar_layer->effect_tree_index()); |
| + EXPECT_FLOAT_EQ(active_scrollbar_layer->Opacity(), |
| + active_tree_node->data.opacity); |
| host_impl_->ScrollbarAnimationControllerForId(scroll->id()) |
| ->DidMouseMoveNear(0); |
| @@ -2886,21 +2889,29 @@ class LayerTreeHostImplTestScrollbarOpacity : public LayerTreeHostImplTest { |
| host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2dF(0, 5)).get()); |
| host_impl_->ScrollEnd(EndState().get()); |
| host_impl_->CreatePendingTree(); |
| + container = host_impl_->pending_tree()->InnerViewportContainerLayer(); |
| + container->test_properties()->force_render_surface = true; |
|
ajuma
2016/06/01 21:09:54
Why do we need a surface here?
jaydasika
2016/06/01 21:12:15
Don't need a surface. I added this so that contain
ajuma
2016/06/01 21:17:09
Ah, makes sense. Please add a comment about that.
jaydasika
2016/06/01 21:23:48
Done.
|
| + container->SetBounds(gfx::Size(10, 10)); |
| + host_impl_->pending_tree()->property_trees()->needs_rebuild = true; |
| + host_impl_->pending_tree()->BuildPropertyTreesForTesting(); |
| + |
| + LayerImpl* pending_scrollbar_layer = |
| + host_impl_->pending_tree()->LayerById(400); |
| EffectNode* pending_tree_node = |
|
jaydasika
2016/06/01 20:50:28
This test will crash if we use effect_tree_index i
|
| host_impl_->pending_tree()->property_trees()->effect_tree.Node( |
| - scrollbar_layer->effect_tree_index()); |
| + pending_scrollbar_layer->effect_tree_index()); |
| host_impl_->pending_tree() |
| ->property_trees() |
| ->always_use_active_tree_opacity_effect_ids.push_back(400); |
| EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity); |
| - EXPECT_FLOAT_EQ(1.f, scrollbar_layer->Opacity()); |
| + EXPECT_FLOAT_EQ(1.f, active_scrollbar_layer->Opacity()); |
| EXPECT_FLOAT_EQ(0.f, pending_tree_node->data.opacity); |
| host_impl_->ActivateSyncTree(); |
| active_tree_node = |
| host_impl_->active_tree()->property_trees()->effect_tree.Node( |
| - scrollbar_layer->effect_tree_index()); |
| + active_scrollbar_layer->effect_tree_index()); |
| EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity); |
| - EXPECT_FLOAT_EQ(1.f, scrollbar_layer->Opacity()); |
| + EXPECT_FLOAT_EQ(1.f, active_scrollbar_layer->Opacity()); |
| } |
| }; |