#include "cc/trees/layer_tree_host.h"
#include <stdint.h>
#include <climits>
#include "base/functional/bind.h"
#include "base/metrics/statistics_recorder.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "cc/animation/animation.h"
#include "cc/animation/animation_host.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/animation/animation_timeline.h"
#include "cc/animation/element_animations.h"
#include "cc/animation/keyframe_effect.h"
#include "cc/animation/scroll_offset_animation_curve.h"
#include "cc/animation/scroll_offset_animation_curve_factory.h"
#include "cc/animation/scroll_offset_animations.h"
#include "cc/base/completion_event.h"
#include "cc/base/features.h"
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/layer_tree_test.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/target_property.h"
#include "cc/trees/transform_node.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "ui/gfx/animation/keyframe/animation_curve.h"
#include "ui/gfx/animation/keyframe/timing_function.h"
#include "ui/gfx/geometry/test/geometry_util.h"
#include "ui/gfx/geometry/transform_operations.h"
namespace cc {
namespace {
#define SAMPLE(curve, time) …
class LayerTreeHostAnimationTest : public LayerTreeTest { … };
class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested);
class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback);
class LayerTreeHostAnimationTestAddKeyframeModel
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestAddKeyframeModel);
class LayerTreeHostAnimationTestNoDamageAnimation
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestNoDamageAnimation);
class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws);
class LayerTreeHostAnimationTestAnimationsGetDeleted
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestAnimationsGetDeleted);
class LayerTreeHostAnimationTestAddKeyframeModelWithTimingFunction
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestAddKeyframeModelWithTimingFunction);
class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestSynchronizeAnimationStartTimes);
class LayerTreeHostAnimationTestAnimationFinishedEvents
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestAnimationFinishedEvents);
class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity);
class LayerTreeHostAnimationTestLayerAddedWithAnimation
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestLayerAddedWithAnimation);
class LayerTreeHostAnimationTestCancelAnimateCommit
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestCancelAnimateCommit);
class LayerTreeHostAnimationTestForceRedraw
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestForceRedraw);
class LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit);
class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations);
class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestScrollOffsetChangesArePropagated);
class LayerTreeHostAnimationTestScrollOffsetAnimationTakeover
: public LayerTreeHostAnimationTest { … };
class LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted);
class LayerTreeHostPresentationDuringAnimation
: public LayerTreeHostAnimationTest { … };
#if !BUILDFLAG(IS_CHROMEOS)
MULTI_THREAD_TEST_F(LayerTreeHostPresentationDuringAnimation);
#endif
class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestScrollOffsetAnimationRemoval);
class LayerTreeHostAnimationTestScrollOffsetAnimationCompletion
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestScrollOffsetAnimationCompletion);
class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers);
class LayerTreeHostAnimationTestAddKeyframeModelAfterAnimating
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestAddKeyframeModelAfterAnimating);
class LayerTreeHostAnimationTestRemoveKeyframeModel
: public LayerTreeHostAnimationTest { … };
#if !BUILDFLAG(IS_CHROMEOS)
SINGLE_THREAD_TEST_F(LayerTreeHostAnimationTestRemoveKeyframeModel);
#endif
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestRemoveKeyframeModel);
class LayerTreeHostAnimationTestIsAnimating
: public LayerTreeHostAnimationTest { … };
#if BUILDFLAG(IS_LINUX) || defined(ADDRESS_SANITIZER) || !defined(NDEBUG)
SINGLE_THREAD_TEST_F(LayerTreeHostAnimationTestIsAnimating);
#else
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestIsAnimating);
#endif
class LayerTreeHostAnimationTestAnimationFinishesDuringCommit
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestAnimationFinishesDuringCommit);
class LayerTreeHostAnimationTestImplSideInvalidation
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestImplSideInvalidation);
class LayerTreeHostAnimationTestImplSideInvalidationWithoutCommit
: public LayerTreeHostAnimationTest { … };
class ImplSideInvalidationWithoutCommitTestOpacity
: public LayerTreeHostAnimationTestImplSideInvalidationWithoutCommit { … };
MULTI_THREAD_TEST_F(ImplSideInvalidationWithoutCommitTestOpacity);
class ImplSideInvalidationWithoutCommitTestTransform
: public LayerTreeHostAnimationTestImplSideInvalidationWithoutCommit { … };
MULTI_THREAD_TEST_F(ImplSideInvalidationWithoutCommitTestTransform);
class ImplSideInvalidationWithoutCommitTestFilter
: public LayerTreeHostAnimationTestImplSideInvalidationWithoutCommit { … };
MULTI_THREAD_TEST_F(ImplSideInvalidationWithoutCommitTestFilter);
class ImplSideInvalidationWithoutCommitTestScroll
: public LayerTreeHostAnimationTestImplSideInvalidationWithoutCommit { … };
MULTI_THREAD_TEST_F(ImplSideInvalidationWithoutCommitTestScroll);
class LayerTreeHostAnimationTestNotifyAnimationFinished
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestNotifyAnimationFinished);
class LayerTreeHostAnimationTestChangeAnimation
: public LayerTreeHostAnimationTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestChangeAnimation);
class LayerTreeHostAnimationTestSetPotentiallyAnimatingOnLacDestruction
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestSetPotentiallyAnimatingOnLacDestruction);
class LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit
: public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
class LayerTreeHostTestPauseRendering : public LayerTreeHostAnimationTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestPauseRendering);
}
}