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

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

Issue 2144303002: Made layout viewport scroll updates from compositor work like ordinary layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerOnCompositor
Patch Set: Created 4 years, 5 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 12fa42170efcdce20439f7fbddd4b50aa80fb6ec..e7aafdcdeac7b1b9c63bae3b1e0f94bbec590182 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5665,12 +5665,15 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
WebLocalFrameImpl* frameImpl = webViewHelper.webViewImpl()->mainFrameImpl();
DocumentLoader::InitialScrollState& initialScrollState =
frameImpl->frame()->loader().documentLoader()->initialScrollState();
+ GraphicsLayer* frameViewLayer = frameImpl->frameView()->layerForScrolling();
EXPECT_FALSE(client.wasFrameScrolled());
EXPECT_FALSE(initialScrollState.wasScrolledByUser);
// Do a compositor scroll, verify that this is counted as a user scroll.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(0, 1), WebFloatSize(), 1.7f, 0);
+ frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(0, 1));
+ frameViewLayer->didScroll();
+ webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.7f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
@@ -5678,20 +5681,25 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
initialScrollState.wasScrolledByUser = false;
// The page scale 1.0f and scroll.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(0, 1), WebFloatSize(), 1.0f, 0);
+ frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(0, 2));
+ frameViewLayer->didScroll();
+ webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
client.reset();
initialScrollState.wasScrolledByUser = false;
// No scroll event if there is no scroll delta.
+ frameViewLayer->didScroll();
webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
EXPECT_FALSE(client.wasFrameScrolled());
EXPECT_FALSE(initialScrollState.wasScrolledByUser);
client.reset();
// Non zero page scale and scroll.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(9, 13), WebFloatSize(), 0.6f, 0);
+ frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(9, 15));
+ frameViewLayer->didScroll();
+ webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 0.6f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
client.reset();

Powered by Google App Engine
This is Rietveld 408576698