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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1146053009: Added experiment for changing viewport scroll ordering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added new about_flag to histograms.xml Created 5 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45acfd36fdb801a58d7edbcbe00e246d8f4a8e1c..248150dcc156f909be04defa8182ecc7c0216047 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -1132,6 +1132,50 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
}
}
+TEST_F(LayerTreeHostImplTest, ScrollDuringPinchScrollsInnerViewport) {
+ LayerTreeSettings settings = DefaultSettings();
+ settings.invert_viewport_scroll_order = true;
+ CreateHostImpl(settings,
+ CreateOutputSurface());
+
+ LayerImpl* inner_scroll_layer =
+ SetupScrollAndContentsLayers(gfx::Size(100, 100));
+
+ // Adjust the content layer to be larger than the outer viewport container so
+ // that we get scrolling in both viewports.
+ LayerImpl* content_layer =
+ host_impl_->OuterViewportScrollLayer()->children().back();
+ LayerImpl* outer_scroll_layer = host_impl_->OuterViewportScrollLayer();
+ LayerImpl* inner_clip_layer =
+ host_impl_->InnerViewportScrollLayer()->parent()->parent();
+ inner_clip_layer->SetBounds(gfx::Size(100, 100));
+ inner_clip_layer->SetContentBounds(gfx::Size(100, 100));
+ outer_scroll_layer->SetBounds(gfx::Size(200, 200));
+ outer_scroll_layer->SetContentBounds(gfx::Size(200, 200));
+ content_layer->SetBounds(gfx::Size(200, 200));
+ content_layer->SetContentBounds(gfx::Size(200, 200));
+
+ host_impl_->SetViewportSize(gfx::Size(100, 100));
+
+ EXPECT_VECTOR_EQ(
+ gfx::Vector2dF(100, 100),
+ outer_scroll_layer->MaxScrollOffset());
+
+ host_impl_->ScrollBegin(gfx::Point(99, 99), InputHandler::GESTURE);
+ host_impl_->PinchGestureBegin();
+ host_impl_->PinchGestureUpdate(2, gfx::Point(99, 99));
+ host_impl_->ScrollBy(gfx::Point(99, 99), gfx::Vector2dF(10.f, 10.f));
+ host_impl_->PinchGestureEnd();
+ host_impl_->ScrollEnd();
+
+ EXPECT_VECTOR_EQ(
+ gfx::Vector2dF(0, 0),
+ outer_scroll_layer->CurrentScrollOffset());
+ EXPECT_VECTOR_EQ(
+ gfx::Vector2dF(50, 50),
+ inner_scroll_layer->CurrentScrollOffset());
+}
+
TEST_F(LayerTreeHostImplTest, ImplPinchZoomWheelBubbleBetweenViewports) {
LayerImpl* inner_scroll_layer =
SetupScrollAndContentsLayers(gfx::Size(100, 100));
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698