#include "third_party/blink/renderer/core/animation/compositor_animations.h"
#include <limits>
#include <memory>
#include <utility>
#include "base/auto_reset.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "cc/animation/animation_host.h"
#include "cc/animation/keyframe_model.h"
#include "cc/layers/picture_layer.h"
#include "cc/trees/transform_node.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalue_double.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalue_string_unrestricteddouble.h"
#include "third_party/blink/renderer/core/animation/animation.h"
#include "third_party/blink/renderer/core/animation/animation_clock.h"
#include "third_party/blink/renderer/core/animation/css/compositor_keyframe_double.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/document_timeline.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/animation/keyframe_effect.h"
#include "third_party/blink/renderer/core/animation/pending_animations.h"
#include "third_party/blink/renderer/core/css/background_color_paint_image_generator.h"
#include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
#include "third_party/blink/renderer/core/css/css_paint_value.h"
#include "third_party/blink/renderer/core/css/css_syntax_definition.h"
#include "third_party/blink/renderer/core/css/css_test_helpers.h"
#include "third_party/blink/renderer/core/css/mock_css_paint_image_generator.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/paint/object_paint_properties.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style/filter_operations.h"
#include "third_party/blink/renderer/core/style/style_generated_image.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_length.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/thread_state.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/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/transforms/transform_operations.h"
#include "third_party/blink/renderer/platform/transforms/translate_transform_operation.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/animation/keyframe/animation_curve.h"
#include "ui/gfx/animation/keyframe/keyframed_animation_curve.h"
#include "ui/gfx/geometry/size.h"
_;
NiceMock;
Return;
ReturnRef;
Values;
namespace blink {
namespace {
MockCSSPaintImageGenerator* g_override_generator = …;
CSSPaintImageGenerator* ProvideOverrideGenerator(
const String&,
const Document&,
CSSPaintImageGenerator::Observer*) { … }
}
RegisterProperty;
class AnimationCompositorAnimationsTest : public PaintTestConfigurations,
public RenderingTest { … };
class LayoutObjectProxy : public LayoutObject { … };
INSTANTIATE_PAINT_TEST_SUITE_P(…);
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorKeyframeMultipleCSSProperties) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorKeyframeEffectModel) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorCustomCssProperty) { … }
TEST_P(AnimationCompositorAnimationsTest,
ConvertTimingForCompositorStartDelay) { … }
TEST_P(AnimationCompositorAnimationsTest,
ConvertTimingForCompositorIterationStart) { … }
TEST_P(AnimationCompositorAnimationsTest,
ConvertTimingForCompositorIterationCount) { … }
TEST_P(AnimationCompositorAnimationsTest,
ConvertTimingForCompositorIterationsAndStartDelay) { … }
TEST_P(AnimationCompositorAnimationsTest, ConvertTimingForCompositorDirection) { … }
TEST_P(AnimationCompositorAnimationsTest,
ConvertTimingForCompositorDirectionIterationsAndStartDelay) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionLinear) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionCubic) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionSteps) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionChainedLinear) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorNonLinearTimingFunctionOnFirstOrLastFrame) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorEffectOpacity) { … }
TEST_P(AnimationCompositorAnimationsTest, ForceReduceMotion) { … }
TEST_P(AnimationCompositorAnimationsTest,
ForceReduceMotionDocumentSupportsReduce) { … }
TEST_P(AnimationCompositorAnimationsTest,
ForceReduceMotionChildDocumentSupportsReduce) { … }
TEST_P(AnimationCompositorAnimationsTest, CheckCanStartForceReduceMotion) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorEffectInvalid) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorEffectFilter) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorEffectTransform) { … }
TEST_P(AnimationCompositorAnimationsTest,
CheckCanStartEffectOnCompositorUnsupportedCSSProperties) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionChainedCubicMatchingOffsets) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionMixedGood) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartEffectOnCompositorTimingFunctionWithStepOrFrameOkay) { … }
TEST_P(AnimationCompositorAnimationsTest, CanStartEffectOnCompositorBasic) { … }
TEST_P(AnimationCompositorAnimationsTest, CreateSimpleOpacityAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleOpacityAnimationDuration) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateMultipleKeyframeOpacityAnimationLinear) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleOpacityAnimationStartDelay) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateMultipleKeyframeOpacityAnimationChained) { … }
TEST_P(AnimationCompositorAnimationsTest, CreateReversedOpacityAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateReversedOpacityAnimationNegativeStartDelay) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleOpacityAnimationFillModeNone) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleOpacityAnimationFillModeAuto) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleOpacityAnimationWithTimingFunction) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateCustomFloatPropertyAnimationWithNonAsciiName) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleCustomFloatPropertyAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
CreateSimpleCustomColorPropertyAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest, MixedCustomPropertyAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
CancelIncompatibleCompositorAnimations) { … }
namespace {
void UpdateDummyTransformNode(ObjectPaintProperties& properties,
CompositingReasons reasons) { … }
void UpdateDummyEffectNode(ObjectPaintProperties& properties,
CompositingReasons reasons) { … }
}
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorTransformBasedOnPaintProperties) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartElementOnCompositorEffectBasedOnPaintProperties) { … }
TEST_P(AnimationCompositorAnimationsTest, TrackRafAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest, TrackRafAnimationTimeout) { … }
TEST_P(AnimationCompositorAnimationsTest, TrackSVGAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest, TrackRafAnimationNoneRegistered) { … }
TEST_P(AnimationCompositorAnimationsTest, CompositedCustomProperty) { … }
TEST_P(AnimationCompositorAnimationsTest, CompositedTransformAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest, CompositedScaleAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
NonAnimatedTransformPropertyChangeGetsUpdated) { … }
TEST_P(AnimationCompositorAnimationsTest,
CannotStartElementOnCompositorEffectSVG) { … }
TEST_P(AnimationCompositorAnimationsTest,
DocumentWithoutSettingShouldNotCauseCrash) { … }
TEST_P(AnimationCompositorAnimationsTest, DetachCompositorTimelinesTest) { … }
TEST_P(AnimationCompositorAnimationsTest,
CanStartTransformAnimationOnCompositorForSVG) { … }
TEST_P(AnimationCompositorAnimationsTest, UnsupportedSVGCSSProperty) { … }
TEST_P(AnimationCompositorAnimationsTest,
TotalAnimationCountAcrossAllDocuments) { … }
TEST_P(AnimationCompositorAnimationsTest,
MainAnimationCountExcludesInactiveAnimations) { … }
TEST_P(AnimationCompositorAnimationsTest, TrackRafAnimationAcrossAllDocuments) { … }
TEST_P(AnimationCompositorAnimationsTest, Fragmented) { … }
TEST_P(AnimationCompositorAnimationsTest,
CancelIncompatibleTransformCompositorAnimation) { … }
TEST_P(AnimationCompositorAnimationsTest,
LongActiveDurationWithNegativePlaybackRate) { … }
class ScopedBackgroundColorPaintImageGenerator { … };
TEST_P(AnimationCompositorAnimationsTest, BackgroundShorthand) { … }
TEST_P(AnimationCompositorAnimationsTest, StaticNonCompositableProperty) { … }
TEST_P(AnimationCompositorAnimationsTest, StaticCompositableProperty) { … }
TEST_P(AnimationCompositorAnimationsTest, EmptyKeyframes) { … }
TEST_P(AnimationCompositorAnimationsTest,
WebKitPrefixedPlusUnprefixedProperty) { … }
}