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

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: Initialize ScrollUpdateInfo's layer id in constructor 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/VisualViewportTest.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/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 37a109134b7063e2967ad2ff4f6ce5c54675a55c..ed4c41d3b3cb942ed194757240e68981f8f20b65 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5662,12 +5662,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);
@@ -5675,20 +5678,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();
« no previous file with comments | « third_party/WebKit/Source/web/tests/VisualViewportTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698