#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/http/http_server_properties.h"
#include <memory>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
#include "net/base/schemeful_site.h"
#include "net/http/http_network_session.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace net {
const base::TimeDelta BROKEN_ALT_SVC_EXPIRE_DELAYS[10] = …;
class HttpServerPropertiesPeer { … };
namespace {
HttpServerProperties::ServerInfoMapKey CreateSimpleKey(
const url::SchemeHostPort& server) { … }
class HttpServerPropertiesTest : public TestWithTaskEnvironment { … };
TEST_F(HttpServerPropertiesTest, SetSupportsSpdy) { … }
TEST_F(HttpServerPropertiesTest, SetSupportsSpdyWebSockets) { … }
TEST_F(HttpServerPropertiesTest, SetSupportsSpdyWithNetworkIsolationKey) { … }
TEST_F(HttpServerPropertiesTest, LoadSupportsSpdy) { … }
TEST_F(HttpServerPropertiesTest, SupportsRequestPriority) { … }
TEST_F(HttpServerPropertiesTest, ClearSupportsSpdy) { … }
TEST_F(HttpServerPropertiesTest, MRUOfServerInfoMap) { … }
AlternateProtocolServerPropertiesTest;
TEST_F(AlternateProtocolServerPropertiesTest, Basic) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ExcludeOrigin) { … }
TEST_F(AlternateProtocolServerPropertiesTest, Set) { … }
TEST_F(AlternateProtocolServerPropertiesTest, SetWebSockets) { … }
TEST_F(AlternateProtocolServerPropertiesTest, SetWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, SetWithEmptyHostname) { … }
TEST_F(AlternateProtocolServerPropertiesTest, EmptyVector) { … }
TEST_F(AlternateProtocolServerPropertiesTest, EmptyVectorForCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ClearServerWithCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest, MRUOfGetAlternativeServiceInfos) { … }
TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
SetBrokenUntilDefaultNetworkChanges) { … }
TEST_F(AlternateProtocolServerPropertiesTest, MaxAge) { … }
TEST_F(AlternateProtocolServerPropertiesTest, MaxAgeCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest, AlternativeServiceWithScheme) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ClearAlternativeServices) { … }
TEST_F(AlternateProtocolServerPropertiesTest, BrokenShadowsCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
MarkBrokenWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, MarkRecentlyBroken) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
MarkRecentlyBrokenWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
MarkBrokenUntilDefaultNetworkChanges) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
MarkBrokenUntilDefaultNetworkChangesWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, OnDefaultNetworkChanged) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
OnDefaultNetworkChangedWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, Canonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ClearCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
CanonicalWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBroken) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
CanonicalBrokenUntilDefaultNetworkChanges) { … }
TEST_F(AlternateProtocolServerPropertiesTest, CanonicalOverride) { … }
TEST_F(AlternateProtocolServerPropertiesTest, ClearWithCanonical) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
ExpireBrokenAlternateProtocolMappings) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
ExpireBrokenAlternateProtocolMappingsWithNetworkIsolationKey) { … }
TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
SetBrokenAlternativeServicesDelayParams1) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
SetBrokenAlternativeServicesDelayParams2) { … }
TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc2) { … }
TEST_F(AlternateProtocolServerPropertiesTest, RemoveExpiredBrokenAltSvc3) { … }
TEST_F(AlternateProtocolServerPropertiesTest,
GetAlternativeServiceInfoAsValue) { … }
TEST_F(HttpServerPropertiesTest, LoadLastLocalAddressWhenQuicWorked) { … }
TEST_F(HttpServerPropertiesTest, SetLastLocalAddressWhenQuicWorked) { … }
TEST_F(HttpServerPropertiesTest, LoadServerNetworkStats) { … }
TEST_F(HttpServerPropertiesTest, SetServerNetworkStats) { … }
TEST_F(HttpServerPropertiesTest, ClearServerNetworkStats) { … }
TEST_F(HttpServerPropertiesTest, OnQuicServerInfoMapLoaded) { … }
TEST_F(HttpServerPropertiesTest, SetQuicServerInfo) { … }
TEST_F(HttpServerPropertiesTest, QuicServerInfoCanonicalSuffixMatch) { … }
TEST_F(HttpServerPropertiesTest,
QuicServerInfoCanonicalSuffixMatchWithNetworkIsolationKey) { … }
TEST_F(HttpServerPropertiesTest,
QuicServerInfoCanonicalSuffixMatchReturnsMruEntry) { … }
TEST_F(HttpServerPropertiesTest,
QuicServerInfoCanonicalSuffixMatchDoesntChangeOrder) { … }
TEST_F(HttpServerPropertiesTest, QuicServerInfoCanonicalSuffixMatchSetInfoMap) { … }
}
}