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

Unified Diff: Source/web/tests/PinchViewportTest.cpp

Issue 1202763005: Scroll only visual viewport during OSX pinch gesture behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/PinchViewportTest.cpp
diff --git a/Source/web/tests/PinchViewportTest.cpp b/Source/web/tests/PinchViewportTest.cpp
index 5014bea02b8d5c03e3187f25b3a1329b04bbeeaa..7515968dbba2a9065ef5960eeca1211ce6be2648 100644
--- a/Source/web/tests/PinchViewportTest.cpp
+++ b/Source/web/tests/PinchViewportTest.cpp
@@ -1687,4 +1687,34 @@ TEST_F(PinchViewportTest, WindowDimensionsOnLoadWideContent)
EXPECT_EQ(std::string("2000x1500"), std::string(output->innerHTML().ascii().data()));
}
+static void turnOnInvertedScrollOrder(WebSettings* settings)
+{
+ PinchViewportTest::configureSettings(settings);
+ settings->setInvertViewportScrollOrder(true);
+}
+
+TEST_F(PinchViewportTest, PinchZoomGestureScrollsVisualViewportOnly)
+{
+ initializeWithDesktopSettings(turnOnInvertedScrollOrder);
+ webViewImpl()->resize(IntSize(100, 100));
+
+ registerMockedHttpURLLoad("200-by-800-viewport.html");
+ navigateTo(m_baseURL + "200-by-800-viewport.html");
+
+ WebGestureEvent pinchUpdate;
+ pinchUpdate.type = WebInputEvent::GesturePinchUpdate;
+ pinchUpdate.x = 100;
+ pinchUpdate.y = 100;
+ pinchUpdate.data.pinchUpdate.scale = 2;
+ pinchUpdate.data.pinchUpdate.zoomDisabled = false;
+
+ webViewImpl()->handleInputEvent(pinchUpdate);
+
+ PinchViewport& pinchViewport = webViewImpl()->page()->frameHost().pinchViewport();
+ FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
+
+ EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), pinchViewport.location());
+ EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble());
+}
+
} // namespace
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | public/web/WebSettings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698