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

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

Issue 103583007: Ensure that if FrameView::isScrollable() is false, the assoc WebLayer is, too. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 11 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: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index cabcf499f4990a57c0810b627fad6b2bf83c2df4..36e24864b2ea9a1af21f63d7110abd65b329abd3 100644
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
@@ -129,7 +129,7 @@ private:
FrameTestHelpers::WebViewHelper m_helper;
};
-TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault)
+TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefaultBodyNotScrollable)
{
navigateTo("about:blank");
forceFullCompositingUpdate();
@@ -140,6 +140,26 @@ TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault)
ASSERT_TRUE(page->scrollingCoordinator());
ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(frameView));
+ // Fast scrolling should be enabled by default, BUT if the main frame is
+ // not scrollable, then the rootScrollLayer shouldn't be scrollable either.
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_FALSE(rootScrollLayer->scrollable());
+ ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread());
+ ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers());
+}
+
+TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefaultBodyScrollable)
+{
+ registerMockedHttpURLLoad("body-overflow-visible.html");
+ navigateTo(m_baseURL + "body-overflow-visible.html");
+ forceFullCompositingUpdate();
+
+ // Make sure the scrolling coordinator is active.
+ FrameView* frameView = frame()->view();
+ Page* page = frame()->page();
+ ASSERT_TRUE(page->scrollingCoordinator());
+ ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(frameView));
+
// Fast scrolling should be enabled by default.
WebLayer* rootScrollLayer = getRootScrollLayer();
ASSERT_TRUE(rootScrollLayer->scrollable());
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/web/tests/data/body-overflow-visible.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698