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

Unified Diff: content/browser/iframe_zoom_browsertest.cc

Issue 1953503005: RenderView needs to know zoom level for loading pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stale comment. Created 4 years, 7 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 | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/iframe_zoom_browsertest.cc
diff --git a/content/browser/iframe_zoom_browsertest.cc b/content/browser/iframe_zoom_browsertest.cc
index ade69ee0f8899c8e75bb660ff135cf47259e12f8..b7ae8c8343b86f5235c0a0069eed79aa9a05b80d 100644
--- a/content/browser/iframe_zoom_browsertest.cc
+++ b/content/browser/iframe_zoom_browsertest.cc
@@ -427,4 +427,40 @@ IN_PROC_BROWSER_TEST_F(IFrameZoomBrowserTest, SubframeRetainsZoomOnNavigation) {
EXPECT_EQ(scale_one_child_width, new_child_width);
}
+// http://crbug.com/609213
+#if !defined(OS_ANDROID)
+IN_PROC_BROWSER_TEST_F(IFrameZoomBrowserTest,
+ RedirectToPageWithSubframeZoomsCorrectly) {
+ std::string initial_host("a.com");
+ std::string redirected_host("b.com");
+ EXPECT_TRUE(NavigateToURL(shell(), GURL(embedded_test_server()->GetURL(
+ initial_host, "/title2.html"))));
+ double main_frame_window_border = GetMainframeWindowBorder(web_contents());
+ EXPECT_DOUBLE_EQ(
+ 1.0, GetMainFrameZoomFactor(web_contents(), main_frame_window_border));
+
+ // Set a zoom level for b.com before we navigate to it.
+ const double kZoomFactorForRedirectedHost = 1.5;
+ HostZoomMap* host_zoom_map = HostZoomMap::GetForWebContents(web_contents());
+ host_zoom_map->SetZoomLevelForHost(
+ redirected_host, ZoomFactorToZoomLevel(kZoomFactorForRedirectedHost));
+
+ // Navigation to a.com doesn't change the zoom level, but when it redirects
+ // to b.com, and then a subframe loads, the zoom should change.
+ GURL redirect_url(embedded_test_server()->GetURL(
+ redirected_host, "/cross_site_iframe_factory.html?b(b)"));
+ GURL url(embedded_test_server()->GetURL(
+ initial_host, "/client-redirect?" + redirect_url.spec()));
+
+ NavigateToURLBlockUntilNavigationsComplete(shell(), url, 2);
+ EXPECT_TRUE(IsLastCommittedEntryOfPageType(web_contents(), PAGE_TYPE_NORMAL));
+ EXPECT_EQ(redirect_url, web_contents()->GetLastCommittedURL());
+
+ EXPECT_NEAR(
+ kZoomFactorForRedirectedHost,
+ GetMainFrameZoomFactor(web_contents(), main_frame_window_border),
+ 0.001);
+}
+#endif
+
} // namespace content
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698