Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2907053004: GSB uses delta_hints to calculate scrolling chain. (Closed)
Patch Set: debug version Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d90ce9970179b993d62b17c5faa0e0b5957a246d..c675245528bda6fc2058dec307ffb17d9ec4bf92 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -830,7 +830,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {
host_impl_->SetViewportSize(gfx::Size(50, 50));
DrawFrame();
-
+ LOG(ERROR) << "Scroll begin";
InputHandler::ScrollStatus status = host_impl_->ScrollBegin(
BeginState(gfx::Point()).get(), InputHandler::WHEEL);
EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
@@ -839,9 +839,11 @@ TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
InputHandler::WHEEL));
+ LOG(ERROR) << "SCroll By";
host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, 10)).get());
EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, 10),
InputHandler::WHEEL));
+ LOG(ERROR) << "scroll end";
host_impl_->ScrollEnd(EndState().get());
EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
InputHandler::WHEEL));
@@ -6049,12 +6051,15 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
// Now reset and scroll the same amount horizontally.
SetScrollOffsetDelta(child_ptr, gfx::Vector2dF());
gfx::Vector2d gesture_scroll_delta(10, 0);
+ LOG(ERROR) << "scroll begin:\n";
EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
host_impl_
- ->ScrollBegin(BeginState(gfx::Point(1, 1)).get(),
+ ->ScrollBegin(BeginState(gfx::Point()).get(),
InputHandler::TOUCHSCREEN)
.thread);
+ LOG(ERROR) << "\nscroll by:\n";
host_impl_->ScrollBy(UpdateState(gfx::Point(), gesture_scroll_delta).get());
+ LOG(ERROR) << "\nscroll begin:\n";
host_impl_->ScrollEnd(EndState().get());
// The child layer shouldn't have scrolled.
@@ -9760,6 +9765,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
BOTH, SHOWN, false);
DrawFrame();
+ LOG(ERROR) << "\nscroll begin:\n";
EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
host_impl_
->ScrollBegin(BeginState(gfx::Point()).get(),
@@ -9768,6 +9774,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
EXPECT_EQ(0, host_impl_->browser_controls_manager()->ControlsTopOffset());
float offset = 50;
+ LOG(ERROR) << "\nscroll by 1:\n";
EXPECT_TRUE(
host_impl_
->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, offset)).get())
@@ -9776,14 +9783,14 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
host_impl_->browser_controls_manager()->ControlsTopOffset());
EXPECT_EQ(gfx::Vector2dF().ToString(),
scroll_layer->CurrentScrollOffset().ToString());
-
+ LOG(ERROR) << "\nscroll by 2:\n";
EXPECT_TRUE(
host_impl_
->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, offset)).get())
.did_scroll);
EXPECT_EQ(gfx::Vector2dF(0, offset).ToString(),
scroll_layer->CurrentScrollOffset().ToString());
-
+ LOG(ERROR) << "\nscroll by 3:\n";
EXPECT_TRUE(
host_impl_
->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, offset)).get())
@@ -9794,7 +9801,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
scroll_layer->CurrentScrollOffset().ToString());
float overscrollamount = 10;
-
+ LOG(ERROR) << "\nscroll by 4:\n";
// Overscroll the content
EXPECT_FALSE(host_impl_
->ScrollBy(UpdateState(gfx::Point(),
@@ -9805,7 +9812,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
scroll_layer->CurrentScrollOffset().ToString());
EXPECT_EQ(gfx::Vector2dF(0, overscrollamount).ToString(),
host_impl_->accumulated_root_overscroll().ToString());
-
+ LOG(ERROR) << "\nscroll by 5:\n";
EXPECT_TRUE(
host_impl_
->ScrollBy(
@@ -9815,7 +9822,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
scroll_layer->CurrentScrollOffset().ToString());
EXPECT_EQ(-offset,
host_impl_->browser_controls_manager()->ControlsTopOffset());
-
+ LOG(ERROR) << "\nscroll by 6:\n";
EXPECT_TRUE(
host_impl_
->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2d(0, -offset)).get())
@@ -9825,7 +9832,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest,
// Browser controls should be fully visible
EXPECT_EQ(0, host_impl_->browser_controls_manager()->ControlsTopOffset());
-
+ LOG(ERROR) << "\nscroll end:\n";
host_impl_->ScrollEnd(EndState().get());
}
@@ -10826,12 +10833,14 @@ TEST_F(LayerTreeHostImplTest, SecondScrollAnimatedBeginNotIgnored) {
const gfx::Size viewport_size(50, 100);
CreateBasicVirtualViewportLayers(viewport_size, content_size);
- EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
- host_impl_->ScrollAnimatedBegin(gfx::Point()).thread);
+ EXPECT_EQ(
+ InputHandler::SCROLL_ON_IMPL_THREAD,
+ host_impl_->ScrollAnimatedBegin(BeginState(gfx::Point()).get()).thread);
// The second ScrollAnimatedBegin should not get ignored.
- EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
- host_impl_->ScrollAnimatedBegin(gfx::Point()).thread);
+ EXPECT_EQ(
+ InputHandler::SCROLL_ON_IMPL_THREAD,
+ host_impl_->ScrollAnimatedBegin(BeginState(gfx::Point()).get()).thread);
}
// Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets

Powered by Google App Engine
This is Rietveld 408576698