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

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

Issue 2680953002: Remove GraphicsLayer::didScroll and directly call ScrollableArea::didScroll (Closed)
Patch Set: Incorporate reviewer comments: more tests, less bad tests Created 3 years, 10 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/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index ccba4beeec25ef232aec53c0f2e2af67505ac7c3..b384736b8b0b4c6278ade442dcf9cc0d944e620d 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -6761,15 +6761,14 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {
WebLocalFrameImpl* frameImpl = webViewHelper.webView()->mainFrameImpl();
DocumentLoader::InitialScrollState& initialScrollState =
frameImpl->frame()->loader().documentLoader()->initialScrollState();
- GraphicsLayer* frameViewLayer = frameImpl->frameView()->layerForScrolling();
EXPECT_FALSE(client.wasFrameScrolled());
EXPECT_FALSE(initialScrollState.wasScrolledByUser);
+ auto* scrollableArea = frameImpl->frameView()->layoutViewportScrollableArea();
+
// Do a compositor scroll, verify that this is counted as a user scroll.
- frameViewLayer->platformLayer()->setScrollPositionDouble(
- WebDoublePoint(0, 1));
- frameViewLayer->didScroll();
+ scrollableArea->didScroll(gfx::ScrollOffset(0, 1));
webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(),
WebFloatSize(), 1.7f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
@@ -6779,9 +6778,7 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {
initialScrollState.wasScrolledByUser = false;
// The page scale 1.0f and scroll.
- frameViewLayer->platformLayer()->setScrollPositionDouble(
- WebDoublePoint(0, 2));
- frameViewLayer->didScroll();
+ scrollableArea->didScroll(gfx::ScrollOffset(0, 2));
webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(),
WebFloatSize(), 1.0f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
@@ -6790,7 +6787,7 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {
initialScrollState.wasScrolledByUser = false;
// No scroll event if there is no scroll delta.
- frameViewLayer->didScroll();
+ scrollableArea->didScroll(gfx::ScrollOffset(0, 2));
webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(),
WebFloatSize(), 1.0f, 0);
EXPECT_FALSE(client.wasFrameScrolled());
@@ -6798,9 +6795,7 @@ TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {
client.reset();
// Non zero page scale and scroll.
- frameViewLayer->platformLayer()->setScrollPositionDouble(
- WebDoublePoint(9, 15));
- frameViewLayer->didScroll();
+ scrollableArea->didScroll(gfx::ScrollOffset(9, 15));
webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(),
WebFloatSize(), 0.6f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
« no previous file with comments | « third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | third_party/WebKit/public/platform/WebLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698