#include "third_party/blink/renderer/core/html/parser/html_preload_scanner.h"
#include <memory>
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "services/network/public/mojom/attribution.mojom-blink.h"
#include "services/network/public/mojom/web_client_hints_types.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/renderer/core/css/media_values_cached.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/cross_origin_attribute.h"
#include "third_party/blink/renderer/core/html/parser/background_html_scanner.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_options.h"
#include "third_party/blink/renderer/core/html/parser/html_resource_preloader.h"
#include "third_party/blink/renderer/core/html/parser/html_tokenizer.h"
#include "third_party/blink/renderer/core/html/parser/preload_request.h"
#include "third_party/blink/renderer/core/lcp_critical_path_predictor/element_locator.h"
#include "third_party/blink/renderer/core/media_type_names.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_response.h"
#include "third_party/blink/renderer/platform/loader/fetch/client_hints_preferences.h"
#include "third_party/blink/renderer/platform/network/http_names.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/weborigin/security_origin.h"
namespace blink {
struct PreloadScannerTestCase { … };
struct RenderBlockingTestCase { … };
struct HTMLPreconnectTestCase { … };
struct ReferrerPolicyTestCase { … };
struct CorsTestCase { … };
struct CSPTestCase { … };
struct NonceTestCase { … };
struct ContextTestCase { … };
struct IntegrityTestCase { … };
struct LazyLoadImageTestCase { … };
struct AttributionSrcTestCase { … };
struct TokenStreamMatcherTestCase { … };
struct SharedStorageWritableTestCase { … };
class HTMLMockHTMLResourcePreloader : public ResourcePreloader { … };
class HTMLPreloadScannerTest : public PageTestBase { … };
TEST_F(HTMLPreloadScannerTest, testImages) { … }
TEST_F(HTMLPreloadScannerTest, testImagesWithViewport) { … }
TEST_F(HTMLPreloadScannerTest, testImagesWithViewportDeviceWidth) { … }
TEST_F(HTMLPreloadScannerTest, testImagesWithViewportDisabled) { … }
TEST_F(HTMLPreloadScannerTest, testViewportNoContent) { … }
TEST_F(HTMLPreloadScannerTest, testMetaAcceptCH) { … }
TEST_F(HTMLPreloadScannerTest, testMetaAcceptCHInsecureDocument) { … }
TEST_F(HTMLPreloadScannerTest, testRenderBlocking) { … }
TEST_F(HTMLPreloadScannerTest, testPreconnect) { … }
TEST_F(HTMLPreloadScannerTest, testDisables) { … }
TEST_F(HTMLPreloadScannerTest, testPicture) { … }
TEST_F(HTMLPreloadScannerTest, testContext) { … }
TEST_F(HTMLPreloadScannerTest, testReferrerPolicy) { … }
TEST_F(HTMLPreloadScannerTest, testCors) { … }
TEST_F(HTMLPreloadScannerTest, testCSP) { … }
TEST_F(HTMLPreloadScannerTest, testNonce) { … }
TEST_F(HTMLPreloadScannerTest, testAttributionSrc) { … }
TEST_F(HTMLPreloadScannerTest, testReferrerPolicyOnDocument) { … }
TEST_F(HTMLPreloadScannerTest, testLinkRelPreload) { … }
TEST_F(HTMLPreloadScannerTest, testNoDataUrls) { … }
TEST_F(HTMLPreloadScannerTest, testScriptTypeAndLanguage) { … }
TEST_F(HTMLPreloadScannerTest, testUppercaseAsValues) { … }
TEST_F(HTMLPreloadScannerTest, ReferrerHeader) { … }
TEST_F(HTMLPreloadScannerTest, Integrity) { … }
TEST_F(HTMLPreloadScannerTest, MetaCsp_NoPreloadsAfter) { … }
TEST_F(HTMLPreloadScannerTest, LazyLoadImage) { … }
TEST_F(HTMLPreloadScannerTest, CSSImportWithSemicolonInUrl) { … }
TEST_F(HTMLPreloadScannerTest, TemplateInteractions) { … }
TEST_F(HTMLPreloadScannerTest, JavascriptBaseUrl) { … }
TEST_F(HTMLPreloadScannerTest, OtherRulesBeforeImport) { … }
TEST_F(HTMLPreloadScannerTest, PreloadLayeredImport) { … }
TEST_F(HTMLPreloadScannerTest, TokenStreamMatcher) { … }
TEST_F(HTMLPreloadScannerTest, testSharedStorageWritable) { … }
enum class LcppPreloadLazyLoadImageType { … };
class HTMLPreloadScannerLCPPLazyLoadImageTest
: public HTMLPreloadScannerTest,
public testing::WithParamInterface<LcppPreloadLazyLoadImageType> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(HTMLPreloadScannerLCPPLazyLoadImageTest,
TokenStreamMatcherWithLoadingLazy) { … }
TEST_P(HTMLPreloadScannerLCPPLazyLoadImageTest,
TokenStreamMatcherWithLoadingLazyAutoSizes) { … }
TEST_F(HTMLPreloadScannerTest, PreloadScanDisabled_NoPreloads) { … }
}