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

Unified Diff: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp

Issue 33413002: scroll: Tell the platform layer whether it can be scrolled by the user. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tot-merge Created 7 years, 2 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 | « Source/web/PinchViewports.cpp ('k') | Source/web/tests/data/overflow-hidden.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index 9c6e80cd5f14398e223bd983fff891c3d980b8d7..053effbc2b1713528e53add4a59242ca236c92f9 100644
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
@@ -303,6 +303,8 @@ TEST_F(ScrollingCoordinatorChromiumTest, overflowScrolling)
WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()->platformLayer();
ASSERT_TRUE(webScrollLayer->scrollable());
+ ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
+ ASSERT_TRUE(webScrollLayer->userScrollableVertical());
#if OS(ANDROID)
// Now verify we've attached impl-side scrollbars onto the scrollbar layers
@@ -313,6 +315,60 @@ TEST_F(ScrollingCoordinatorChromiumTest, overflowScrolling)
#endif
}
+TEST_F(ScrollingCoordinatorChromiumTest, overflowHidden)
+{
+ registerMockedHttpURLLoad("overflow-hidden.html");
+ navigateTo(m_baseURL + "overflow-hidden.html");
+
+ // Verify the properties of the accelerated scrolling element starting from the RenderObject
+ // all the way to the WebLayer.
+ Element* overflowElement = m_webViewImpl->mainFrameImpl()->frame()->document()->getElementById("unscrollable-y");
+ ASSERT(overflowElement);
+
+ RenderObject* renderer = overflowElement->renderer();
+ ASSERT_TRUE(renderer->isBoxModelObject());
+ ASSERT_TRUE(renderer->hasLayer());
+
+ RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
+ ASSERT_TRUE(layer->usesCompositedScrolling());
+ ASSERT_EQ(PaintsIntoOwnBacking, layer->compositingState());
+
+ CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping();
+ ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer());
+ ASSERT(compositedLayerMapping->scrollingContentsLayer());
+
+ GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
+ ASSERT_EQ(layer->scrollableArea(), graphicsLayer->scrollableArea());
+
+ WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()->platformLayer();
+ ASSERT_TRUE(webScrollLayer->scrollable());
+ ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
+ ASSERT_FALSE(webScrollLayer->userScrollableVertical());
+
+ overflowElement = m_webViewImpl->mainFrameImpl()->frame()->document()->getElementById("unscrollable-x");
+ ASSERT(overflowElement);
+
+ renderer = overflowElement->renderer();
+ ASSERT_TRUE(renderer->isBoxModelObject());
+ ASSERT_TRUE(renderer->hasLayer());
+
+ layer = toRenderBoxModelObject(renderer)->layer();
+ ASSERT_TRUE(layer->usesCompositedScrolling());
+ ASSERT_EQ(PaintsIntoOwnBacking, layer->compositingState());
+
+ compositedLayerMapping = layer->compositedLayerMapping();
+ ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer());
+ ASSERT(compositedLayerMapping->scrollingContentsLayer());
+
+ graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
+ ASSERT_EQ(layer->scrollableArea(), graphicsLayer->scrollableArea());
+
+ webScrollLayer = compositedLayerMapping->scrollingContentsLayer()->platformLayer();
+ ASSERT_TRUE(webScrollLayer->scrollable());
+ ASSERT_FALSE(webScrollLayer->userScrollableHorizontal());
+ ASSERT_TRUE(webScrollLayer->userScrollableVertical());
+}
+
TEST_F(ScrollingCoordinatorChromiumTest, iframeScrolling)
{
registerMockedHttpURLLoad("iframe-scrolling.html");
« no previous file with comments | « Source/web/PinchViewports.cpp ('k') | Source/web/tests/data/overflow-hidden.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698