#include "content/browser/renderer_host/navigation_request.h"
#include <optional>
#include <string>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/i18n/number_formatting.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/origin_trials_controller_delegate.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_navigation_throttle.h"
#include "content/test/fenced_frame_test_utils.h"
#include "content/test/navigation_simulator_impl.h"
#include "content/test/test_content_browser_client.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_web_contents.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
#include "third_party/blink/public/common/origin_trials/scoped_test_origin_trial_policy.h"
#include "third_party/blink/public/common/runtime_feature_state/runtime_feature_state_context.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
namespace content {
class NavigationRequestTest : public RenderViewHostImplTestHarness { … };
TEST_F(NavigationRequestTest, SimpleDataChecksRedirectAndProcess) { … }
TEST_F(NavigationRequestTest, SimpleDataCheckNoRedirect) { … }
TEST_F(NavigationRequestTest, SimpleDataChecksFailure) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillStart) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillRedirect) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillFail) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillRedirectNoIgnore) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillFailNoIgnore) { … }
TEST_F(NavigationRequestTest, CancelDeferredWillCommitWithoutUrlLoader) { … }
TEST_F(NavigationRequestTest, WillFailRequestSetsSSLInfo) { … }
TEST_F(NavigationRequestTest, SharedStorageWritable) { … }
namespace {
class GetRenderFrameHostOnFailureNavigationThrottle
: public NavigationThrottle { … };
class ThrottleTestContentBrowserClient : public ContentBrowserClient { … };
}
TEST_F(NavigationRequestTest, WillFailRequestCanAccessRenderFrameHost) { … }
TEST_F(NavigationRequestTest, PolicyContainerInheritance) { … }
TEST_F(NavigationRequestTest, DnsAliasesCanBeAccessed) { … }
TEST_F(NavigationRequestTest, NoDnsAliases) { … }
TEST_F(NavigationRequestTest, StorageKeyToCommit) { … }
TEST_F(NavigationRequestTest, RuntimeFeatureStateStorageKey) { … }
TEST_F(NavigationRequestTest,
NavigationToCredentiallessDocumentNetworkIsolationInfo) { … }
TEST_F(NavigationRequestTest, UpdatePrivateNetworkRequestPolicy) { … }
class CSPEmbeddedEnforcementUnitTest : public NavigationRequestTest { … };
TEST_F(CSPEmbeddedEnforcementUnitTest, TopLevel) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, ChildNoCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, ChildWithCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, ChildSiblingNoCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, ChildSiblingCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, GrandChildNoCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, GrandChildSameCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, GrandChildDifferentCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, InvalidCSP) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest, InvalidCspAndInheritFromParent) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest,
SemiInvalidCspAndInheritSameCspFromParent) { … }
TEST_F(CSPEmbeddedEnforcementUnitTest,
SemiInvalidCspAndInheritDifferentCspFromParent) { … }
namespace {
class OriginTrialsControllerDelegateMock
: public OriginTrialsControllerDelegate { … };
}
class PersistentOriginTrialNavigationRequestTest
: public NavigationRequestTest { … };
TEST_F(PersistentOriginTrialNavigationRequestTest,
NavigationCommitsPersistentOriginTrials) { … }
namespace {
class ResponseBodyNavigationThrottle : public NavigationThrottle { … };
}
class NavigationRequestResponseBodyTest : public NavigationRequestTest { … };
TEST_F(NavigationRequestResponseBodyTest, Received) { … }
TEST_F(NavigationRequestResponseBodyTest, PartiallyReceived) { … }
TEST_F(NavigationRequestResponseBodyTest, PipeClosed) { … }
TEST_F(NavigationRequestTest, ViewTransitionForceEnablesPageSwap) { … }
}