chromium/third_party/blink/renderer/core/paint/cull_rect_updater_test.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/paint/cull_rect_updater.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"

namespace blink {

class CullRectUpdaterTest
    : public PaintControllerPaintTestBase,
      public testing::WithParamInterface<bool>,
      private ScopedDynamicScrollCullRectExpansionForTest {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(CullRectUpdaterTest, SimpleCullRect) {}

TEST_P(CullRectUpdaterTest, TallLayerCullRect) {}

TEST_P(CullRectUpdaterTest, WideLayerCullRect) {}

TEST_P(CullRectUpdaterTest, VerticalRLWritingModeDocument) {}

TEST_P(CullRectUpdaterTest, VerticalRLWritingModeScrollDiv) {}

TEST_P(CullRectUpdaterTest, ScaledCullRect) {}

TEST_P(CullRectUpdaterTest, ScaledCullRectUnderCompositedScroller) {}

TEST_P(CullRectUpdaterTest, ScaledAndRotatedCullRect) {}

TEST_P(CullRectUpdaterTest, ScaledAndRotatedCullRectUnderCompositedScroller) {}

// This is a testcase for https://crbug.com/1227907 where repeated cull rect
// updates are expensive on the motionmark microbenchmark.
TEST_P(CullRectUpdaterTest, OptimizeNonCompositedTransformUpdate) {}

TEST_P(CullRectUpdaterTest, 3DRotated90DegreesCullRect) {}

TEST_P(CullRectUpdaterTest, 3DRotatedNear90DegreesCullRect) {}

TEST_P(CullRectUpdaterTest, PerspectiveCullRect) {}

TEST_P(CullRectUpdaterTest, 3D60DegRotatedTallCullRect) {}

TEST_P(CullRectUpdaterTest, FixedPositionInNonScrollableViewCullRect) {}

TEST_P(CullRectUpdaterTest, FixedPositionInScrollableViewCullRect) {}

TEST_P(CullRectUpdaterTest, LayerOffscreenNearCullRect) {}

TEST_P(CullRectUpdaterTest, LayerOffscreenFarCullRect) {}

TEST_P(CullRectUpdaterTest, ScrollingLayerCullRect) {}

TEST_P(CullRectUpdaterTest, NonCompositedScrollingLayerCullRect) {}

TEST_P(CullRectUpdaterTest, ClippedBigLayer) {}

TEST_P(CullRectUpdaterTest, TallScrolledLayerCullRect) {}

TEST_P(CullRectUpdaterTest, WholeDocumentCullRect) {}

TEST_P(CullRectUpdaterTest, FixedPositionUnderClipPath) {}

TEST_P(CullRectUpdaterTest, FixedPositionUnderClipPathWillChangeTransform) {}

TEST_P(CullRectUpdaterTest, AbsolutePositionUnderNonContainingStackingContext) {}

TEST_P(CullRectUpdaterTest, StackedChildOfNonStackingContextScroller) {}

TEST_P(CullRectUpdaterTest, ContentsCullRectCoveringWholeContentsRect) {}

TEST_P(CullRectUpdaterTest, SVGForeignObject) {}

TEST_P(CullRectUpdaterTest, LayerUnderSVGHiddenContainer) {}

TEST_P(CullRectUpdaterTest, PerspectiveDescendants) {}

// Test case for crbug.com/1382842.
TEST_P(CullRectUpdaterTest, UpdateOnCompositedScrollingStatusChange) {}

TEST_P(CullRectUpdaterTest, StickyPositionInCompositedScroller) {}

TEST_P(CullRectUpdaterTest, StickyPositionInNonCompositedScroller) {}

TEST_P(CullRectUpdaterTest, NestedOverriddenCullRectScopes) {}

TEST_P(CullRectUpdaterTest, OverriddenCullRectWithoutExpansion) {}

TEST_P(CullRectUpdaterTest, LimitedDynamicCullRectExpansionY) {}

TEST_P(CullRectUpdaterTest, LimitedDynamicCullRectExpansionX) {}

TEST_P(CullRectUpdaterTest, ViewScrollNeedsCullRectUpdate) {}

// The test doesn't apply on Android or iOS where the LayoutObject of <select>
// doesn't scroll.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_P(CullRectUpdaterTest, SelectDoesntExpandCullRect) {}
#endif

TEST_P(CullRectUpdaterTest, InputDoesntExpandCullRect) {}

class CullRectUpdateOnPaintPropertyChangeTest : public CullRectUpdaterTest {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, Opacity) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, NonPixelMovingFilter) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, PixelMovingFilter) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, Transform) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, AnimatingTransform) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, ScrollContentsSizeChange) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest, SmallContentsScroll) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest,
       LargeContentsScrollSmallDeltaOrNotExposingNewContents1) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest,
       LargeContentsScrollSmallDeltaOrNotExposingNewContents2) {}

TEST_P(CullRectUpdateOnPaintPropertyChangeTest,
       LargeContentsScrollExposingNewContents) {}

}  // namespace blink