#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include <utility>
#include "base/auto_reset.h"
#include "base/containers/span.h"
#include "base/rand_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/unguessable_token.h"
#include "net/storage_access_api/status.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_encoding_data.h"
#include "third_party/blink/public/platform/web_navigation_body_loader.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/core/dom/visited_link_state.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/testing/scoped_fake_plugin_registry.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_client.h"
#include "third_party/blink/renderer/platform/loader/static_data_navigation_body_loader.h"
#include "third_party/blink/renderer/platform/network/blink_schemeful_site.h"
#include "third_party/blink/renderer/platform/storage/blink_storage_key.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_loader_mock_factory.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"
namespace blink {
namespace {
class DecodedBodyLoader : public StaticDataNavigationBodyLoader { … };
class BodyLoaderTestDelegate : public URLLoaderTestDelegate { … };
struct TestVisitedLink { … };
class VisitedLinkPlatform : public TestingPlatformSupport { … };
enum TestMode { … };
class DocumentLoaderTest : public testing::Test,
public ::testing::WithParamInterface<TestMode> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(DocumentLoaderTest, SingleChunk) { … }
TEST_P(DocumentLoaderTest, MultiChunkNoReentrancy) { … }
TEST_P(DocumentLoaderTest, MultiChunkWithReentrancy) { … }
TEST_P(DocumentLoaderTest, isCommittedButEmpty) { … }
class DocumentLoaderSimTest : public SimTest { … };
TEST_F(DocumentLoaderSimTest, DocumentOpenUpdatesUrl) { … }
TEST_F(DocumentLoaderSimTest, FramePolicyIntegrityOnNavigationCommit) { … }
TEST_P(DocumentLoaderTest, CommitsDeferredOnSameOriginNavigation) { … }
TEST_P(DocumentLoaderTest,
CommitsNotDeferredOnDifferentOriginNavigationWithCrossOriginDisabled) { … }
TEST_P(DocumentLoaderTest,
CommitsDeferredOnDifferentOriginNavigationWithCrossOriginEnabled) { … }
TEST_P(DocumentLoaderTest,
CommitsNotDeferredOnDifferentPortNavigationWithCrossOriginDisabled) { … }
TEST_P(DocumentLoaderTest,
CommitsDeferredOnDifferentPortNavigationWithCrossOriginEnabled) { … }
TEST_P(DocumentLoaderTest, CommitsNotDeferredOnDataURLNavigation) { … }
TEST_P(DocumentLoaderTest,
CommitsNotDeferredOnDataURLNavigationWithCrossOriginEnabled) { … }
TEST_P(DocumentLoaderTest, NavigationToAboutBlank) { … }
TEST_P(DocumentLoaderTest, SameOriginNavigation) { … }
TEST_P(DocumentLoaderTest, SameOriginNavigation_WithStorageAccess) { … }
TEST_P(DocumentLoaderTest, CrossOriginNavigation) { … }
TEST_P(DocumentLoaderTest, StorageKeyFromNavigationParams) { … }
TEST_P(DocumentLoaderTest, StorageKeyCrossSiteFromNavigationParams) { … }
TEST_P(DocumentLoaderTest, JavascriptURLKeepsStorageKeyNonce) { … }
TEST_P(DocumentLoaderTest, DiscardingFrameKeepsStorageKeyNonce) { … }
TEST_P(DocumentLoaderTest, PublicSecureNotCounted) { … }
TEST_P(DocumentLoaderTest, PublicNonSecureNotCounted) { … }
TEST_P(DocumentLoaderTest, PrivateSecureNotCounted) { … }
TEST_P(DocumentLoaderTest, PrivateNonSecureIsCounted) { … }
TEST_P(DocumentLoaderTest, LocalNonSecureIsCounted) { … }
TEST_F(DocumentLoaderSimTest, PrivateNonSecureChildFrameNotCounted) { … }
TEST_P(DocumentLoaderTest, DecodedBodyData) { … }
TEST_P(DocumentLoaderTest, DecodedBodyDataWithBlockedParser) { … }
TEST_P(DocumentLoaderTest, EmbeddedCredentialsNavigation) { … }
TEST_P(DocumentLoaderTest, VisitedLinkSalt) { … }
TEST_P(DocumentLoaderTest, PartitionedVisitedLinksMainFrame) { … }
}
}