Commit b308a1ce authored by alexmos's avatar alexmos Committed by Commit bot

Fix RenderProcessHostUnitTest.RendererProcessLimit to pass with --site-per-process.

The --site-per-process mode does not allow renderer process reuse, so this test shouldn't run under that flag.

BUG=417518

Review URL: https://codereview.chromium.org/600993002

Cr-Commit-Position: refs/heads/master@{#297029}
parent 459b9796
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
#include <limits> #include <limits>
#include "base/command_line.h"
#include "content/public/common/content_constants.h" #include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/mock_render_process_host.h" #include "content/public/test/mock_render_process_host.h"
#include "content/test/test_render_view_host.h" #include "content/test/test_render_view_host.h"
...@@ -31,6 +33,15 @@ TEST_F(RenderProcessHostUnitTest, GuestsAreNotSuitableHosts) { ...@@ -31,6 +33,15 @@ TEST_F(RenderProcessHostUnitTest, GuestsAreNotSuitableHosts) {
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
TEST_F(RenderProcessHostUnitTest, RendererProcessLimit) { TEST_F(RenderProcessHostUnitTest, RendererProcessLimit) {
// This test shouldn't run with --site-per-process or
// --enable-strict-site-isolation modes, since they don't allow renderer
// process reuse, which this test explicitly exercises.
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kSitePerProcess) ||
command_line.HasSwitch(switches::kEnableStrictSiteIsolation))
return;
// Disable any overrides. // Disable any overrides.
RenderProcessHostImpl::SetMaxRendererProcessCount(0); RenderProcessHostImpl::SetMaxRendererProcessCount(0);
......
...@@ -568,10 +568,13 @@ static SiteInstanceImpl* CreateSiteInstance(BrowserContext* browser_context, ...@@ -568,10 +568,13 @@ static SiteInstanceImpl* CreateSiteInstance(BrowserContext* browser_context,
// Test to ensure that pages that require certain privileges are grouped // Test to ensure that pages that require certain privileges are grouped
// in processes with similar pages. // in processes with similar pages.
TEST_F(SiteInstanceTest, ProcessSharingByType) { TEST_F(SiteInstanceTest, ProcessSharingByType) {
// This test shouldn't run with --site-per-process mode, since it doesn't // This test shouldn't run with --site-per-process or
// allow render process reuse, which this test explicitly exercises. // --enable-strict-site-isolation modes, since they don't allow render
if (base::CommandLine::ForCurrentProcess()->HasSwitch( // process reuse, which this test explicitly exercises.
switches::kSitePerProcess)) const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kSitePerProcess) ||
command_line.HasSwitch(switches::kEnableStrictSiteIsolation))
return; return;
// On Android by default the number of renderer hosts is unlimited and process // On Android by default the number of renderer hosts is unlimited and process
......
...@@ -127,7 +127,7 @@ extern const char kEnableSkiaBenchmarking[]; ...@@ -127,7 +127,7 @@ extern const char kEnableSkiaBenchmarking[];
CONTENT_EXPORT extern const char kEnableSmoothScrolling[]; CONTENT_EXPORT extern const char kEnableSmoothScrolling[];
CONTENT_EXPORT extern const char kEnableSpatialNavigation[]; CONTENT_EXPORT extern const char kEnableSpatialNavigation[];
CONTENT_EXPORT extern const char kEnableStatsTable[]; CONTENT_EXPORT extern const char kEnableStatsTable[];
extern const char kEnableStrictSiteIsolation[]; CONTENT_EXPORT extern const char kEnableStrictSiteIsolation[];
CONTENT_EXPORT extern const char kEnableServiceWorkerSync[]; CONTENT_EXPORT extern const char kEnableServiceWorkerSync[];
CONTENT_EXPORT extern const char kEnableTcpFastOpen[]; CONTENT_EXPORT extern const char kEnableTcpFastOpen[];
CONTENT_EXPORT extern const char kEnableThreadedCompositing[]; CONTENT_EXPORT extern const char kEnableThreadedCompositing[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment