Index: content/browser/site_per_process_browsertest.cc |
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc |
index 55a2ab9ccfdf381c510fc51fe2d1ba762dbe1398..e51fd5bfde6ce6cbb3403744a6774525bfc41a5b 100644 |
--- a/content/browser/site_per_process_browsertest.cc |
+++ b/content/browser/site_per_process_browsertest.cc |
@@ -626,13 +626,23 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIBrowserTest, |
"a.com", "/cross_site_iframe_factory.html?a(b)")); |
NavigateToURL(shell(), main_url); |
- EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor, |
- GetFrameDeviceScaleFactor(web_contents())); |
+ // On Android forcing device scale factor does not work for tests, therefore |
+ // we ensure that make frame and iframe have the same DIP scale there, but |
+ // not necessarily kDeviceScaleFactor. |
+ const double expected_dip_scale = |
+#if defined(OS_ANDROID) |
+ GetFrameDeviceScaleFactor(web_contents()); |
+#else |
+ SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor; |
+#endif |
+ |
+ EXPECT_EQ(expected_dip_scale, GetFrameDeviceScaleFactor(web_contents())); |
FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
+ ASSERT_EQ(1U, root->child_count()); |
+ |
FrameTreeNode* child = root->child_at(0); |
- EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor, |
- GetFrameDeviceScaleFactor(child)); |
+ EXPECT_EQ(expected_dip_scale, GetFrameDeviceScaleFactor(child)); |
} |
// Ensure that navigating subframes in --site-per-process mode works and the |