X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcc%2Ftrees%2Flayer_tree_host_impl_unittest.cc;h=0071fe0a732eade87d5d08f17e42b80d2bf16aca;hb=8be7648e3bc188a587d5050c5a945c1099957e8b;hp=351ec356968a1cee57baaded51a05c00cc2cc9de;hpb=3cb1527a1d0111fd75188ac2c34c117944473076;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/cc/trees/layer_tree_host_impl_unittest.cc b/src/cc/trees/layer_tree_host_impl_unittest.cc index 351ec35..0071fe0 100644 --- a/src/cc/trees/layer_tree_host_impl_unittest.cc +++ b/src/cc/trees/layer_tree_host_impl_unittest.cc @@ -3162,10 +3162,7 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) { EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity()); } -TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) { - // Edge glow effect should be applicable only upon reaching Edges - // of the content. unnecessary glow effect calls shouldn't be - // called while scrolling up without reaching the edge of the content. +TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) { gfx::Size surface_size(100, 100); gfx::Size content_size(200, 200); scoped_ptr root_clip = @@ -3186,6 +3183,9 @@ TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) { host_impl_->active_tree()->DidBecomeActive(); DrawFrame(); { + // Edge glow effect should be applicable only upon reaching Edges + // of the content. unnecessary glow effect calls shouldn't be + // called while scrolling up without reaching the edge of the content. EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel)); host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 100)); @@ -3195,6 +3195,20 @@ TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) { EXPECT_EQ(gfx::Vector2dF().ToString(), host_impl_->accumulated_root_overscroll().ToString()); host_impl_->ScrollEnd(); + // unusedrootDelta should be subtracted from applied delta so that + // unwanted glow effect calls are not called. + EXPECT_EQ(InputHandler::ScrollStarted, + host_impl_->ScrollBegin(gfx::Point(0, 0), + InputHandler::NonBubblingGesture)); + EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin()); + host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20)); + EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), + host_impl_->accumulated_root_overscroll().ToString()); + + host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.02f, -0.01f)); + EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(), + host_impl_->accumulated_root_overscroll().ToString()); + host_impl_->ScrollEnd(); } }