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

Unified Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2750463005: Remove top controls clipping adjustment for document.rootScroller (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
index 09c549340a09765dbb10d352afcc04a38d15d5a9..0ce5504bb0353d26ba529b9b1399d9ff8e584142 100644
--- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -730,127 +730,6 @@ TEST_F(RootScrollerTest, RemoteMainFrame) {
m_helper.reset();
}
-// Tests that the clipping layer is resized on the root scroller element even
-// if the layout height doesn't change.
-TEST_F(RootScrollerTest, BrowserControlsResizeClippingLayer) {
- bool oldInertTopControls = RuntimeEnabledFeatures::inertTopControlsEnabled();
- RuntimeEnabledFeatures::setInertTopControlsEnabled(true);
-
- initialize("root-scroller.html");
- Element* container = mainFrame()->document()->getElementById("container");
-
- {
- mainFrame()->document()->setRootScroller(container);
-
- mainFrameView()->updateAllLifecyclePhases();
- ASSERT_EQ(toLayoutBox(container->layoutObject())->clientHeight(), 400);
-
- GraphicsLayer* clipLayer = toLayoutBox(container->layoutObject())
- ->layer()
- ->compositedLayerMapping()
- ->scrollingLayer();
- ASSERT_EQ(clipLayer->size().height(), 400);
- }
-
- {
- webViewImpl()->handleInputEvent(
- generateTouchGestureEvent(WebInputEvent::GestureScrollBegin));
-
- // Scrolling over the #container DIV should cause the browser controls to
- // hide.
- EXPECT_FLOAT_EQ(1, browserControls().shownRatio());
- webViewImpl()->handleInputEvent(generateTouchGestureEvent(
- WebInputEvent::GestureScrollUpdate, 0, -browserControls().height()));
- EXPECT_FLOAT_EQ(0, browserControls().shownRatio());
-
- webViewImpl()->handleInputEvent(
- generateTouchGestureEvent(WebInputEvent::GestureScrollEnd));
-
- webViewImpl()->resizeWithBrowserControls(IntSize(400, 450), 50, false);
-
- EXPECT_FALSE(container->layoutObject()->needsLayout());
-
- mainFrameView()->updateAllLifecyclePhases();
-
- // Since inert top controls are enabled, the container should not have
- // resized, however, the clip layer should.
- EXPECT_EQ(toLayoutBox(container->layoutObject())->clientHeight(), 400);
- GraphicsLayer* clipLayer = toLayoutBox(container->layoutObject())
- ->layer()
- ->compositedLayerMapping()
- ->scrollingLayer();
- EXPECT_EQ(clipLayer->size().height(), 450);
- }
-
- RuntimeEnabledFeatures::setInertTopControlsEnabled(oldInertTopControls);
-}
-
-// Tests that the clipping layer is resized on the root scroller element when
-// it's an iframe and even if the layout height doesn't change.
-TEST_F(RootScrollerTest, BrowserControlsResizeClippingLayerIFrame) {
- bool oldInertTopControls = RuntimeEnabledFeatures::inertTopControlsEnabled();
- RuntimeEnabledFeatures::setInertTopControlsEnabled(true);
-
- initialize("root-scroller-iframe.html");
-
- Element* iframe = mainFrame()->document()->getElementById("iframe");
- LocalFrame* childFrame =
- toLocalFrame(toHTMLFrameOwnerElement(iframe)->contentFrame());
-
- PaintLayerCompositor* childPLC =
- childFrame->view()->layoutViewItem().compositor();
-
- // Give the iframe itself scrollable content and make it the root scroller.
- {
- NonThrowableExceptionState nonThrow;
- mainFrame()->document()->setRootScroller(iframe, nonThrow);
-
- WebLocalFrame* childWebFrame =
- mainWebFrame()->firstChild()->toWebLocalFrame();
- executeScript(
- "document.getElementById('container').style.width = '300%';"
- "document.getElementById('container').style.height = '300%';",
- *childWebFrame);
-
- mainFrameView()->updateAllLifecyclePhases();
-
- // Some sanity checks to make sure the test is setup correctly.
- ASSERT_EQ(childFrame->view()->visibleContentSize().height(), 400);
- ASSERT_EQ(childPLC->containerLayer()->size().height(), 400);
- ASSERT_EQ(childPLC->rootGraphicsLayer()->size().height(), 400);
- }
-
- {
- webViewImpl()->handleInputEvent(
- generateTouchGestureEvent(WebInputEvent::GestureScrollBegin));
-
- // Scrolling over the #container DIV should cause the browser controls to
- // hide.
- EXPECT_FLOAT_EQ(1, browserControls().shownRatio());
- webViewImpl()->handleInputEvent(generateTouchGestureEvent(
- WebInputEvent::GestureScrollUpdate, 0, -browserControls().height()));
- EXPECT_FLOAT_EQ(0, browserControls().shownRatio());
-
- webViewImpl()->handleInputEvent(
- generateTouchGestureEvent(WebInputEvent::GestureScrollEnd));
-
- webViewImpl()->resizeWithBrowserControls(IntSize(400, 450), 50, false);
-
- EXPECT_FALSE(childFrame->view()->needsLayout());
-
- mainFrameView()->updateAllLifecyclePhases();
-
- // Since inert top controls are enabled, the iframe element should not have
- // resized, however, its clip layer should resize to reveal content as the
- // browser controls hide.
- EXPECT_EQ(childFrame->view()->visibleContentSize().height(), 400);
- EXPECT_EQ(childPLC->containerLayer()->size().height(), 450);
- EXPECT_EQ(childPLC->rootGraphicsLayer()->size().height(), 450);
- }
-
- RuntimeEnabledFeatures::setInertTopControlsEnabled(oldInertTopControls);
-}
-
// Tests that removing the root scroller element from the DOM resets the
// effective root scroller without waiting for any lifecycle events.
TEST_F(RootScrollerTest, RemoveRootScrollerFromDom) {
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698