#include "content/public/browser/site_isolation_policy.h"
#include "base/command_line.h"
#include "base/test/scoped_command_line.h"
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
TEST(SiteIsolationPolicyTest, DisableSiteIsolationSwitch) { … }
#if BUILDFLAG(IS_ANDROID)
TEST(SiteIsolationPolicyTest, DisableSiteIsolationForPolicySwitch) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSitePerProcess)) {
return;
}
SiteIsolationPolicy::DisableFlagCachingForTesting();
base::test::ScopedCommandLine scoped_command_line;
base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine();
command_line->AppendSwitch(switches::kDisableSiteIsolationForPolicy);
EXPECT_FALSE(SiteIsolationPolicy::UseDedicatedProcessesForAllSites());
EXPECT_FALSE(SiteIsolationPolicy::AreIsolatedOriginsEnabled());
EXPECT_FALSE(SiteIsolationPolicy::AreDynamicIsolatedOriginsEnabled());
EXPECT_TRUE(SiteIsolationPolicy::IsErrorPageIsolationEnabled(true));
}
#endif
class ApplicationIsolationEnablingBrowserClient : public ContentBrowserClient { … };
}