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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 2222403002: Revert of Remove dependency of c/b/loader on c/b/host_zoom_map_impl.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « content/renderer/render_frame_impl_browsertest.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 0f0f1a35bb38e08434bb34825a57b2cc4582b290..64556e6969084e2caa7e133c395db71bbe7633f2 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -1628,6 +1628,32 @@
}
#endif
+TEST_F(RenderViewImplTest, ZoomLimit) {
+ const double kMinZoomLevel = ZoomFactorToZoomLevel(kMinimumZoomFactor);
+ const double kMaxZoomLevel = ZoomFactorToZoomLevel(kMaximumZoomFactor);
+
+ // Verifies navigation to a URL with preset zoom level indeed sets the level.
+ // Regression test for http://crbug.com/139559, where the level was not
+ // properly set when it is out of the default zoom limits of WebView.
+ CommonNavigationParams common_params;
+ common_params.url = GURL("data:text/html,min_zoomlimit_test");
+ view()->OnSetZoomLevelForLoadingURL(common_params.url, kMinZoomLevel);
+ frame()->Navigate(common_params, StartNavigationParams(),
+ RequestNavigationParams());
+ ProcessPendingMessages();
+ EXPECT_DOUBLE_EQ(kMinZoomLevel, view()->GetWebView()->zoomLevel());
+
+ // It should work even when the zoom limit is temporarily changed in the page.
+ view()->GetWebView()->zoomLimitsChanged(ZoomFactorToZoomLevel(1.0),
+ ZoomFactorToZoomLevel(1.0));
+ common_params.url = GURL("data:text/html,max_zoomlimit_test");
+ view()->OnSetZoomLevelForLoadingURL(common_params.url, kMaxZoomLevel);
+ frame()->Navigate(common_params, StartNavigationParams(),
+ RequestNavigationParams());
+ ProcessPendingMessages();
+ EXPECT_DOUBLE_EQ(kMaxZoomLevel, view()->GetWebView()->zoomLevel());
+}
+
TEST_F(RenderViewImplTest, SetEditableSelectionAndComposition) {
// Load an HTML page consisting of an input field.
LoadHTML("<html>"
« no previous file with comments | « content/renderer/render_frame_impl_browsertest.cc ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698