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 bcbc6c38280551860dcb56604095d2da2cbd50db..effd3b18018b5cfa258cef15bdfa9fac3e9293f3 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -3162,6 +3162,38 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) { |
EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity()); |
} |
+TEST_F(LayerTreeHostImplTest, GlowEffectOverScroll) { |
+ // When we scroll down and scroll up unnecessary GlowEffect calls are called. |
danakj
2014/03/25 15:36:57
"are called" -> "should not be called"
|
+ gfx::Size surface_size(100, 100); |
+ gfx::Size content_size(200, 200); |
+ scoped_ptr<LayerImpl> root_clip = |
+ LayerImpl::Create(host_impl_->active_tree(), 3); |
+ scoped_ptr<LayerImpl> root = |
+ CreateScrollableLayer(1, content_size, root_clip.get()); |
+ root->SetIsContainerForFixedPositionLayers(true); |
+ scoped_ptr<LayerImpl> child = |
+ CreateScrollableLayer(2, content_size, root_clip.get()); |
+ |
+ child->SetScrollClipLayer(Layer::INVALID_ID); |
+ root->AddChild(child.Pass()); |
+ root_clip->AddChild(root.Pass()); |
+ |
+ host_impl_->SetViewportSize(surface_size); |
+ host_impl_->active_tree()->SetRootLayer(root_clip.Pass()); |
+ host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID); |
+ host_impl_->active_tree()->DidBecomeActive(); |
+ DrawFrame(); |
+ { |
+ EXPECT_EQ(InputHandler::ScrollStarted, |
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel)); |
+ host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 100)); |
+ EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll()); |
danakj
2014/03/25 15:36:57
can you compare EXPECT_EQ(gfx::Vector2dF().ToStrin
|
+ host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, -2.30)); |
+ EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll()); |
danakj
2014/03/25 15:36:57
same
|
+ host_impl_->ScrollEnd(); |
+ } |
+} |
+ |
class BlendStateCheckLayer : public LayerImpl { |
public: |
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, |