#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/policy/profile_policy_connector_builder.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/network_session_configurator/common/network_switches.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/network_service_util.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_mock_cert_verifier.h"
#include "net/base/net_errors.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/cert_test_util.h"
#include "net/test/quic_simple_test_server.h"
#include "net/test/test_data_directory.h"
#include "services/network/public/mojom/network_service_test.mojom.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_switches.h"
#endif
namespace {
bool IsQuicEnabled(network::mojom::NetworkContext* network_context) { … }
bool IsQuicEnabled(Profile* profile) { … }
bool IsQuicEnabledForSystem() { … }
bool IsQuicEnabledForSafeBrowsing(Profile* profile) { … }
}
namespace policy {
class QuicTestBase : public InProcessBrowserTest { … };
class QuicAllowedPolicyTestBase : public QuicTestBase { … };
class QuicAllowedPolicyIsFalse : public QuicAllowedPolicyTestBase { … };
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsFalse, QuicDisallowedForSystem) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsFalse,
QuicDisallowedForSafeBrowsing) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsFalse, QuicDisallowedForProfile) { … }
class QuicAllowedPolicyIsTrue : public QuicAllowedPolicyTestBase { … };
#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_QuicAllowedForSystem …
#else
#define MAYBE_QuicAllowedForSystem …
#endif
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsTrue, MAYBE_QuicAllowedForSystem) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsTrue, QuicAllowedForSafeBrowsing) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsTrue,
DISABLED_QuicAllowedForProfile) { … }
class QuicAllowedPolicyIsNotSet : public QuicAllowedPolicyTestBase { … };
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyIsNotSet, NoQuicRegulations) { … }
class QuicAllowedPolicyDynamicTest : public QuicTestBase { … };
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyDynamicTest, QuicAllowedFalseThenTrue) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyDynamicTest, QuicAllowedTrueThenFalse) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyDynamicTest,
SecondProfileCreatedWhenQuicAllowedFalse) { … }
IN_PROC_BROWSER_TEST_F(QuicAllowedPolicyDynamicTest,
QuicAllowedFalseAfterTwoProfilesCreated) { … }
}