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

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

Issue 405263002: Base new scale on minimum-scale after orientation change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring back contentsSize != 0 check Created 6 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 | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/resize_scroll_minimum_scale.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index ca41c956a3022dfd0888293a101abff91e6af1d9..b4922f59db012011f9f42135abc59bf53f910e4f 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2042,6 +2042,22 @@ TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForWidthEqualsDevice
url, initialPageScaleFactor, scrollOffset, viewportSize, shouldScaleRelativeToViewportWidth);
}
+TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForMinimumScale)
+{
+ // This tests a scenario where minimum-scale is set to 1.0, but some element
+ // on the page is slightly larger than the portrait width, so our "natural"
+ // minimum-scale would be lower. In that case, we should stick to 1.0 scale
+ // on rotation and not do anything strange.
+ const char* url = "resize_scroll_minimum_scale.html";
+ const float initialPageScaleFactor = 1;
+ const WebSize scrollOffset(0, 0);
+ const WebSize viewportSize(240, 320);
+ const bool shouldScaleRelativeToViewportWidth = false;
+
+ testResizeYieldsCorrectScrollAndScale(
+ url, initialPageScaleFactor, scrollOffset, viewportSize, shouldScaleRelativeToViewportWidth);
+}
+
TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForFixedWidth)
{
// With a fixed width, pageScaleFactor scales by the relative change in viewport width.
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/resize_scroll_minimum_scale.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698