#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/html/lazy_load_frame_observer.h"
#include <memory>
#include <optional>
#include <tuple>
#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "third_party/blink/public/platform/web_effective_connection_type.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/sim/sim_compositor.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/network/network_state_notifier.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
namespace {
enum class LazyFrameVisibleLoadTimeFeatureStatus { … };
class LazyLoadFramesParamsTest
: public SimTest,
public ::testing::WithParamInterface<
std::tuple<LazyFrameVisibleLoadTimeFeatureStatus,
WebEffectiveConnectionType>> { … };
TEST_P(LazyLoadFramesParamsTest, SameOriginFrame) { … }
TEST_P(LazyLoadFramesParamsTest, AboveTheFoldFrame) { … }
TEST_P(LazyLoadFramesParamsTest, BelowTheFoldButNearViewportFrame) { … }
TEST_P(LazyLoadFramesParamsTest, LoadCrossOriginFrameFarFromViewport) { … }
TEST_P(LazyLoadFramesParamsTest,
CrossOriginFrameFarFromViewportBecomesVisibleBeforeFinishedLoading) { … }
TEST_P(LazyLoadFramesParamsTest, NestedFrameInCrossOriginFrameFarFromViewport) { … }
TEST_P(LazyLoadFramesParamsTest, AboutBlankChildFrameNavigation) { … }
TEST_P(LazyLoadFramesParamsTest, JavascriptStringFrameUrl) { … }
TEST_P(LazyLoadFramesParamsTest,
CrossOriginFrameFarFromViewportWithLoadingAttributeEager) { … }
TEST_P(LazyLoadFramesParamsTest,
LoadSameOriginFrameFarFromViewportWithLoadingAttributeLazy) { … }
TEST_P(LazyLoadFramesParamsTest,
LoadCrossOriginFrameFarFromViewportThenSetLoadingAttributeEager) { … }
TEST_P(LazyLoadFramesParamsTest,
NestedFrameWithLazyLoadAttributeOnInFrameWithNoLoadingAttribute) { … }
TEST_P(LazyLoadFramesParamsTest,
NestedFrameWithLazyLoadAttributeOnInFrameWithLoadingAttributeEager) { … }
TEST_P(LazyLoadFramesParamsTest,
NestedFrameWithLazyLoadAttributeOffInFrameWithLoadingAttributeEager) { … }
INSTANTIATE_TEST_SUITE_P(…);
class LazyLoadFramesTest : public SimTest { … };
TEST_F(LazyLoadFramesTest, LazyLoadFrameUnsetLoadingAttributeWithoutAutomatic) { … }
TEST_F(LazyLoadFramesTest, LazyLoadWhenAttrLazy) { … }
TEST_F(LazyLoadFramesTest, LazyLoadWhenAttrEager) { … }
TEST_F(LazyLoadFramesTest, LazyLoadWhenAutomaticDisabled) { … }
TEST_F(LazyLoadFramesTest, DeferredForAttributeLazy) { … }
}
}