chromium/cc/animation/animation_host_unittest.cc

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

#include "cc/animation/animation_host.h"

#include <limits>

#include "base/memory/ptr_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/animation/animation_timeline.h"
#include "cc/animation/scroll_timeline.h"
#include "cc/animation/worklet_animation.h"
#include "cc/base/features.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/animation_timelines_test_common.h"
#include "cc/test/mock_layer_tree_mutator.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
InvokeWithoutArgs;
Mock;
NiceMock;
Return;

namespace cc {
namespace {

// Helper method to convert base::TimeTicks to double.
// Returns double milliseconds if the input value is resolved or
// std::numeric_limits<double>::quiet_NaN() otherwise.
double ToMilliseconds(std::optional<base::TimeTicks> time_ticks) {}

class AnimationHostTest : public AnimationTimelinesTest {};

// See Animation tests on layer registration/unregistration in
// animation_unittest.cc.

TEST_F(AnimationHostTest, SyncTimelinesAddRemove) {}

TEST_F(AnimationHostTest, ImplOnlyTimeline) {}

TEST_F(AnimationHostTest, ImplOnlyScrollAnimationUpdateTargetIfDetached) {}

// Tests that verify interaction of AnimationHost with LayerTreeMutator.

TEST_F(AnimationHostTest, FastLayerTreeMutatorUpdateTakesEffectInSameFrame) {}

TEST_F(AnimationHostTest, LayerTreeMutatorsIsMutatedWithCorrectInputState) {}

TEST_F(AnimationHostTest, LayerTreeMutatorsIsMutatedOnlyWhenInputChanges) {}

class MockAnimation : public Animation {};

bool Animation1TimeEquals20(MutatorInputState* input) {}

void CreateScrollingNodeForElement(ElementId element_id,
                                   PropertyTrees* property_trees,
                                   bool is_composited = true) {}

void SetScrollOffset(PropertyTrees* property_trees,
                     ElementId element_id,
                     gfx::PointF offset) {}

// TODO(kevers): Scroll-timelines are specced to work in percentages but work
// internally in units of time for convenience. Since the timeline duration is
// not exposed as a time, the time scaling factor is not externally visible.
// For now, the test is simply disabled. If work on AnimationWorklets resumes
// and scroll timelines become an integral part, then we can revisit the test.
TEST_F(AnimationHostTest,
       DISABLED_LayerTreeMutatorUpdateReflectsScrollAnimations) {}

TEST_F(AnimationHostTest, TickScrollLinkedAnimation) {}

TEST_F(AnimationHostTest, TickScrollLinkedAnimationNonCompositedScroll) {}

TEST_F(AnimationHostTest, TickScrollLinkedAnimationSmooth) {}

TEST_F(AnimationHostTest, PushPropertiesToImpl) {}

TEST_F(AnimationHostTest, ScrollTimelineOffsetUpdatedByScrollAnimation) {}

}  // namespace
}  // namespace cc