Index: content/browser/site_instance_impl_unittest.cc |
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc |
index 646f4d079577593e5fdc0be8d9a10c8dc1696a19..fe76b484fc460c8b43a645026f77e40c876c37f3 100644 |
--- a/content/browser/site_instance_impl_unittest.cc |
+++ b/content/browser/site_instance_impl_unittest.cc |
@@ -562,6 +562,13 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) |
return; |
+ // On Android by default the number of renderer hosts is unlimited and process |
+ // sharing doesn't happen. We set the override so that the test can run |
+ // everywhere. |
+ size_t old_renderer_process_limit = |
+ RenderProcessHost::GetMaxRendererProcessCount(); |
+ RenderProcessHost::SetMaxRendererProcessCount(kMaxRendererProcessCount); |
+ |
ChildProcessSecurityPolicyImpl* policy = |
ChildProcessSecurityPolicyImpl::GetInstance(); |
@@ -607,6 +614,9 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) { |
} |
DrainMessageLoops(); |
+ |
+ // Disable the process limit override. |
+ RenderProcessHost::SetMaxRendererProcessCount(0); |
} |
// Test to ensure that HasWrongProcessForURL behaves properly for different |