#include "base/containers/span.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "cc/base/features.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/recording_source.h"
#include "cc/layers/surface_layer.h"
#include "cc/trees/compositor_commit_data.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/web/web_script_source.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/core/testing/fake_remote_frame_host.h"
#include "third_party/blink/renderer/core/testing/scoped_mock_overlay_scrollbars.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/graphics/compositing/paint_artifact_compositor.h"
#include "third_party/blink/renderer/platform/testing/find_cc_layer.h"
#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/text/base64.h"
namespace blink {
#define EXPECT_SKCOLOR4F_NEAR(expected, actual, error) …
class CompositingTest : public PaintTestConfigurations, public testing::Test { … };
INSTANTIATE_PAINT_TEST_SUITE_P(…);
TEST_P(CompositingTest, DisableAndEnableAcceleratedCompositing) { … }
TEST_P(CompositingTest, DidScrollCallbackAfterScrollableAreaChanges) { … }
TEST_P(CompositingTest, FrameViewScroll) { … }
TEST_P(CompositingTest, WillChangeTransformHint) { … }
TEST_P(CompositingTest, WillChangeTransformHintInSVG) { … }
TEST_P(CompositingTest, Compositing3DTransformOnSVGModelObject) { … }
TEST_P(CompositingTest, Compositing3DTransformOnSVGBlock) { … }
TEST_P(CompositingTest, NotCompositing3DTransformOnSVGInline) { … }
TEST_P(CompositingTest, PaintPropertiesWhenCompositingSVG) { … }
TEST_P(CompositingTest, BackgroundColorInScrollingContentsLayer) { … }
TEST_P(CompositingTest, BackgroundColorInGraphicsLayer) { … }
TEST_P(CompositingTest, ContainPaintLayerBounds) { … }
TEST_P(CompositingTest, CompositedOverlayScrollbarUnderNonFastBorderRadius) { … }
TEST_P(CompositingTest,
FullPACUpdateOnScrollWithSyntheticClipAcrossScrollerSimpleRadius) { … }
TEST_P(CompositingTest,
FullPACUpdateOnScrollWithSyntheticClipAcrossScrollerComplexRadius) { … }
TEST_P(CompositingTest, HitTestOpaqueness) { … }
TEST_P(CompositingTest, HitTestOpaquenessOfSolidColorLayer) { … }
TEST_P(CompositingTest, HitTestOpaquenessOnChangeOfUsedPointerEvents) { … }
TEST_P(CompositingTest,
NonStackedScrollerWithRelativeChildAboveFixedAndAbsolute) { … }
TEST_P(CompositingTest, AnchorPositionAdjustmentTransformIdReference) { … }
TEST_P(CompositingTest, ScrollingContentsCullRect) { … }
class CompositingSimTest : public PaintTestConfigurations, public SimTest { … };
INSTANTIATE_PAINT_TEST_SUITE_P(…);
TEST_P(CompositingSimTest, LayerUpdatesDoNotInvalidateEarlierLayers) { … }
TEST_P(CompositingSimTest, LayerUpdatesDoNotInvalidateLaterLayers) { … }
TEST_P(CompositingSimTest,
NoopChangeDoesNotCauseFullTreeSyncOrPropertyTreeUpdate) { … }
TEST_P(CompositingSimTest, LayerSubtreeTransformPropertyChanged) { … }
TEST_P(CompositingSimTest, DirectTransformPropertyUpdate) { … }
TEST_P(CompositingSimTest, FastPathTransformUpdateFromStyle) { … }
TEST_P(CompositingSimTest, FastPathOpacityUpdateFromStyle) { … }
TEST_P(CompositingSimTest, DirectSVGTransformPropertyUpdate) { … }
TEST_P(CompositingSimTest, DirectTransformPropertyUpdateCausesChange) { … }
TEST_P(CompositingSimTest, AffectedByOuterViewportBoundsDelta) { … }
TEST_P(CompositingSimTest, DirectTransformOriginPropertyUpdate) { … }
TEST_P(CompositingSimTest, LayerSubtreeEffectPropertyChanged) { … }
TEST_P(CompositingSimTest, LayerSubtreeClipPropertyChanged) { … }
TEST_P(CompositingSimTest, LayerSubtreeOverflowClipPropertyChanged) { … }
TEST_P(CompositingSimTest, LayerClipPropertyChanged) { … }
TEST_P(CompositingSimTest, SafeOpaqueBackgroundColor) { … }
TEST_P(CompositingSimTest, SquashingLayerSafeOpaqueBackgroundColor) { … }
TEST_P(CompositingSimTest, RootScrollingContentsSafeOpaqueBackgroundColor) { … }
TEST_P(CompositingSimTest, NonDrawableLayersIgnoredForRenderSurfaces) { … }
TEST_P(CompositingSimTest, NoRenderSurfaceWithAxisAlignedTransformAnimation) { … }
TEST_P(CompositingSimTest, PromoteCrossOriginIframe) { … }
TEST_P(CompositingSimTest, PromoteCrossOriginIframeAfterLoading) { … }
TEST_P(CompositingSimTest, PromoteCrossOriginToParent) { … }
TEST_P(CompositingSimTest, PromoteCrossOriginIframeAfterDomainChange) { … }
TEST_P(CompositingSimTest, PromoteCrossOriginToParentIframeAfterDomainChange) { … }
TEST_P(CompositingTest, EffectNodesShouldHaveElementIds) { … }
TEST_P(CompositingSimTest, ImplSideScrollSkipsCommit) { … }
TEST_P(CompositingSimTest, RasterInducingScrollSkipsCommit) { … }
TEST_P(CompositingSimTest, ImplSideScrollUnpaintedSkipsCommit) { … }
TEST_P(CompositingSimTest, ImplSideScaleSkipsCommit) { … }
TEST_P(CompositingSimTest, MainThreadScaleUpdatesTransformTree) { … }
TEST_P(CompositingSimTest, BuildTreeSetsScaleOnTransformTree) { … }
TEST_P(CompositingSimTest, ScrollWithMainThreadReasonsNeedsCommit) { … }
TEST_P(CompositingSimTest, FrameAttribution) { … }
TEST_P(CompositingSimTest, VisibleFrameRootLayers) { … }
TEST_P(CompositingSimTest, DecompositedTransformWithChange) { … }
TEST_P(CompositingSimTest, BackgroundColorChangeUsesRepaintUpdate) { … }
TEST_P(CompositingSimTest, MultipleChunkBackgroundColorChangeRepaintUpdate) { … }
TEST_P(CompositingSimTest, SVGColorChangeUsesRepaintUpdate) { … }
TEST_P(CompositingSimTest, ChangingOpaquenessRequiresFullUpdate) { … }
TEST_P(CompositingSimTest, ChangingContentsOpaqueForTextRequiresFullUpdate) { … }
TEST_P(CompositingSimTest, ChangingDrawsContentRequiresFullUpdate) { … }
TEST_P(CompositingSimTest, ContentsOpaqueForTextWithSubpixelSizeSimpleBg) { … }
TEST_P(CompositingSimTest, ContentsOpaqueForTextWithSubpixelSizeComplexBg) { … }
TEST_P(CompositingSimTest, ContentsOpaqueForTextWithPartialBackground) { … }
TEST_P(CompositingSimTest, ContentsOpaqueForTextWithBorderRadiusAndPadding) { … }
TEST_P(CompositingSimTest, FullCompositingUpdateReasons) { … }
TEST_P(CompositingSimTest, FullCompositingUpdateReasonWithCompositedSVG) { … }
TEST_P(CompositingSimTest, FullCompositingUpdateForJustCreatedChunks) { … }
TEST_P(CompositingSimTest, FullCompositingUpdateForUncachableChunks) { … }
TEST_P(CompositingSimTest, DecompositeScrollerInHiddenIframe) { … }
TEST_P(CompositingSimTest, ForeignLayersInMovedSubsequence) { … }
TEST_P(CompositingSimTest, SolidColorLayersWithSnapping) { … }
TEST_P(CompositingSimTest, SolidColorLayerWithSubpixelTransform) { … }
TEST_P(CompositingSimTest, EffectCompositedWith3DTransform) { … }
TEST_P(CompositingSimTest, CompositorAnimationOfOpacityHasPaintedContent) { … }
TEST_P(CompositingSimTest, CompositorAnimationOfNonInvertibleTransform) { … }
TEST_P(CompositingSimTest, CompositorAnimationRevealsChild) { … }
static String ImageFileAsDataURL(const String& filename) { … }
TEST_P(CompositingSimTest, CompositedImageWithSubpixelOffset) { … }
TEST_P(CompositingSimTest, CompositedImageWithSubpixelOffsetAndOrientation) { … }
TEST_P(CompositingSimTest, ScrollingContentsLayerRecordedBounds) { … }
TEST_P(CompositingSimTest, NestedBoxReflectCrash) { … }
TEST_P(CompositingSimTest, ScrollbarLayerWithDecompositedTransform) { … }
}