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

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

Issue 2285253003: Move TopDocumentRootScrollerController to a separate object on FrameHost (Closed)
Patch Set: None Created 4 years, 4 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: 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 465e8ffd860b4804205e9231cec0c9cb3d3854f3..f2b6df045515c6e1ff44c700c466a7d70a9a6425 100644
--- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -8,6 +8,7 @@
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/page/Page.h"
#include "core/page/scrolling/RootScrollerController.h"
+#include "core/page/scrolling/TopDocumentRootScrollerController.h"
#include "core/paint/PaintLayerScrollableArea.h"
#include "platform/testing/URLTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
@@ -510,8 +511,8 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
Element* container =
iframe->contentDocument()->getElementById("container");
- RootScrollerController* mainController =
- mainFrame()->document()->rootScrollerController();
+ TopDocumentRootScrollerController& mainController =
tdresser 2016/08/30 15:05:30 Can this be const?
bokan 2016/08/30 16:13:39 Done.
+ mainFrame()->document()->frameHost()->globalRootScrollerController();
NonThrowableExceptionState nonThrow;
@@ -519,9 +520,9 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
// and the main FrameView's scroll layer should be the layer to use.
{
EXPECT_EQ(
- mainController->rootScrollerLayer(),
+ mainController.rootScrollerLayer(),
mainFrameView()->layerForScrolling());
- EXPECT_TRUE(mainController->isViewportScrollCallback(
+ EXPECT_TRUE(mainController.isViewportScrollCallback(
mainFrame()->document()->documentElement()->getApplyScroll()));
}
@@ -532,9 +533,9 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
iframe->contentDocument()->setRootScroller(container, nonThrow);
EXPECT_EQ(
- mainController->rootScrollerLayer(),
+ mainController.rootScrollerLayer(),
mainFrameView()->layerForScrolling());
- EXPECT_TRUE(mainController->isViewportScrollCallback(
+ EXPECT_TRUE(mainController.isViewportScrollCallback(
mainFrame()->document()->documentElement()->getApplyScroll()));
}
@@ -549,11 +550,11 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
toLayoutBox(container->layoutObject())->getScrollableArea());
EXPECT_EQ(
- mainController->rootScrollerLayer(),
+ mainController.rootScrollerLayer(),
containerScroller->layerForScrolling());
- EXPECT_FALSE(mainController->isViewportScrollCallback(
+ EXPECT_FALSE(mainController.isViewportScrollCallback(
mainFrame()->document()->documentElement()->getApplyScroll()));
- EXPECT_TRUE(mainController->isViewportScrollCallback(
+ EXPECT_TRUE(mainController.isViewportScrollCallback(
container->getApplyScroll()));
}
@@ -563,13 +564,13 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
{
iframe->contentDocument()->setRootScroller(nullptr, nonThrow);
EXPECT_EQ(
- mainController->rootScrollerLayer(),
+ mainController.rootScrollerLayer(),
iframe->contentDocument()->view()->layerForScrolling());
- EXPECT_FALSE(mainController->isViewportScrollCallback(
+ EXPECT_FALSE(mainController.isViewportScrollCallback(
container->getApplyScroll()));
- EXPECT_FALSE(mainController->isViewportScrollCallback(
+ EXPECT_FALSE(mainController.isViewportScrollCallback(
mainFrame()->document()->documentElement()->getApplyScroll()));
- EXPECT_TRUE(mainController->isViewportScrollCallback(
+ EXPECT_TRUE(mainController.isViewportScrollCallback(
iframe->contentDocument()->documentElement()->getApplyScroll()));
}
@@ -578,13 +579,13 @@ TEST_F(RootScrollerTest, SetRootScrollerIframeUsesCorrectLayerAndCallback)
{
mainFrame()->document()->setRootScroller(nullptr, nonThrow);
EXPECT_EQ(
- mainController->rootScrollerLayer(),
+ mainController.rootScrollerLayer(),
mainFrameView()->layerForScrolling());
- EXPECT_TRUE(mainController->isViewportScrollCallback(
+ EXPECT_TRUE(mainController.isViewportScrollCallback(
mainFrame()->document()->documentElement()->getApplyScroll()));
- EXPECT_FALSE(mainController->isViewportScrollCallback(
+ EXPECT_FALSE(mainController.isViewportScrollCallback(
container->getApplyScroll()));
- EXPECT_FALSE(mainController->isViewportScrollCallback(
+ EXPECT_FALSE(mainController.isViewportScrollCallback(
iframe->contentDocument()->documentElement()->getApplyScroll()));
}
}

Powered by Google App Engine
This is Rietveld 408576698